#StackBounty: #linux #xorg #keyboard Bind key combonations to commands and suppress all others

Bounty: 50

I’m trying to make my keyboard function a bit like a stenotype (but not). I want to bind combinations of keys to commands and ignore the standard individual key presses.

I am on GNU/Linux, using Xorg. I don’t mind if the solution relies on Xorg.

Utilities like sxhkd and xbindkeys can bind key combinations to commands, capturing those events but I don’t know how I could make them suppress everything beside the specified key combinations.

Does anyone know how I could do this? Could you point me in the right direction in Linux generally, a utility, or something in a programming language? I know shell scripting, Python, and I am just beginning to learn C. This keyboard module for Python looked good but there’s currently no key suppression for Linux .


Get this bounty!!!

#StackBounty: #linux #x11 #xorg #display xorg configuration 10bpc/30bpp

Bounty: 50

I’m trying to set my display into 10bpc (30bpp) depth.
I should mention my video card and display are capable of this since it’s working from MS Windows.

After adding the following lines to a file under my /etc/X11/xorg.conf.d directory:

Section "Screen"
       Identifier "Screen0"
       DefaultDepth 30
       SubSection "Display"
               Depth 30
       EndSubSection
EndSection

there were some changes in my xorg.0.log … but insufficient to make the change (presumably due to the 8 bit DAC line) (I included the warning, maybe it helps)

[   356.589] (II) modesetting: Driver for Modesetting Kernel Drivers: kms
[   356.616] (II) AMDGPU(0): [KMS] Kernel modesetting enabled.
[   356.616] (WW) Falling back to old probe method for modesetting
[   356.616] (**) AMDGPU(0): Depth 30, (--) framebuffer bpp 32
[   356.616] (II) AMDGPU(0): Pixel depth = 30 bits stored in 4 bytes (32 bpp pixmaps)
[   356.616] (==) AMDGPU(0): Default visual is TrueColor
[   356.616] (==) AMDGPU(0): RGB weight 101010
[   356.616] (II) AMDGPU(0): Using 10 bits per RGB (8 bit DAC)
[   356.616] (--) AMDGPU(0): Chipset: "AMD Radeon VII" (ChipID = 0x66af)

without the config file those lines from the xorg log look like:

[   482.778] (II) modesetting: Driver for Modesetting Kernel Drivers: kms
[   482.808] (II) AMDGPU(0): [KMS] Kernel modesetting enabled.
[   482.809] (WW) Falling back to old probe method for modesetting
[   482.809] (II) AMDGPU(0): Creating default Display subsection in Screen section
        "Default Screen Section" for depth/fbbpp 24/32
[   482.809] (==) AMDGPU(0): Depth 24, (--) framebuffer bpp 32
[   482.809] (II) AMDGPU(0): Pixel depth = 24 bits stored in 4 bytes (32 bpp pixmaps)
[   482.809] (==) AMDGPU(0): Default visual is TrueColor
[   482.809] (==) AMDGPU(0): RGB weight 888
[   482.809] (II) AMDGPU(0): Using 8 bits per RGB (8 bit DAC)
[   482.809] (--) AMDGPU(0): Chipset: "AMD Radeon VII" (ChipID = 0x66af)

So the thing I included in the config seems to be useful but not sufficient to switch to 30bpp/10bpc.

My question is what else needs to be set up or what is the misconfiguration that results in me still having just an 8 bit image sent to my display although mesa is using 10 bits per channel?


Get this bounty!!!

#StackBounty: #linux #debian #xorg How do I get out of a login loop?

Bounty: 100

I recently upgraded from Debian Jessie to Stretch and had a hard time getting X to start due to graphics conflicts. I sorted those out through a series of purge and reinstall commands and was excited to see the familiar login screen. Unfortunately for me, after I enter my password, the screen briefly blinks and I’m still at the login screen.

I can get into the system without problem on one of the other TTY but I can’t seem to get the desktop to come up.

Other things of note:

  • I have checked the .Xauthority permissions/ownership and they are fine (as are the rest of the files in my home.)
  • It doesn’t seem to matter which desktop I choose (I have Fluxbox, Gnome, and X11 options) it always comes right back.
  • The logs seem pretty clear, nothing stands out as suspect to me

Edit:
The Xorg.0.log has the following EE lines:

(EE) open /dev/dri/card0: No such file or directory
(EE) Screen 0 deleted because of no matching config section
(EE) AIGLX: reverting to software rendering

Edit2:
Home has 100G of free space, root has 2.4G

.xsession-errors is empty

Adding a new user also loops. Trying to delete that user after looping the login says the user is in use by /lib/systemd/systemd --user


Get this bounty!!!

#StackBounty: #xorg #ps #pam #limit "Xorg" process does not take limits from /etc/security/limits.conf

Bounty: 500

I have this in my /etc/security/limits.conf:

#<domain>   <type>  <item>         <value>
root        -       memlock     65536
root        -       stack       524288
root        -       nice        -20
root        -       nofile      16384

yet, the process /usr/lib/xorg/Xorg, which does run as root still has only 1024 for RLIMIT_NOFILE:

cat /proc/$(pgrep Xorg)/limits | grep 'open file'
Max open files            1024                 4096                 files   

Why are my settings in /etc/security/limits.conf not reflected in Xorg ?
Where can I increase limits for /usr/lib/xorg/Xorg ?

My system is Debian Buster without systemd (I am using sysvinit). And I am using slim as login manager. So I guess it is slim, that launches Xserver. Below is the pam module used by slim:

cat /etc/pam.d/slim
auth    requisite       pam_nologin.so
auth    required        pam_env.so readenv=1
auth    required        pam_env.so readenv=1 envfile=/etc/default/locale

@include common-auth
@include common-account

session required        pam_limits.so
session required        pam_loginuid.so

@include common-session
@include common-password


Get this bounty!!!

#StackBounty: #nvidia #gnome #xorg #multiple-monitors Gnome ignoring second monitor Ubuntu 19.10

Bounty: 200

tl;dr: I have an Ubuntu 19.10 setup that recognises both monitors (lspci shows both and I get a cursor on the second one) but xrandr -q and GNOME only see one of them. What might be the problem?


I set up a new system with a pair of GeForce RTX 2080 Ti cards and a 4K monitor connected to each via USB-C.

After installing Ubuntu 19.10, only one monitor came up. Running sudo nvidia-settings gave me a sample xconfig, which I appended to /usr/share/X11/xorg.conf.d/10-nvidia.conf. The result:

Section "OutputClass"
    Identifier "nvidia"
    MatchDriver "nvidia-drm"
    Driver "nvidia"
    Option "AllowEmptyInitialConfiguration"
    ModulePath "/usr/lib/x86_64-linux-gnu/nvidia/xorg"
EndSection

# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings:  version 435.21

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
    Screen      1  "Screen1" RightOf "Screen0"
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
    Option         "Xinerama" "0"
EndSection

Section "Files"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/psaux"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Keyboard0"
    Driver         "kbd"
EndSection

Section "Monitor"
    # HorizSync source: edid, VertRefresh source: edid
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "LG Electronics LG HDR 4K"
    HorizSync       30.0 - 135.0
    VertRefresh     56.0 - 61.0
    Option         "DPMS"
EndSection

Section "Monitor"
    # HorizSync source: unknown, VertRefresh source: unknown
    Identifier     "Monitor1"
    VendorName     "Unknown"
    ModelName      "LG Electronics LG HDR 4K"
    HorizSync       0.0 - 0.0
    VertRefresh     0.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce RTX 2080 Ti"
    BusID          "PCI:10:0:0"
EndSection

Section "Device"
    Identifier     "Device1"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce RTX 2080 Ti"
    BusID          "PCI:4:0:0"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "Stereo" "0"
    Option         "nvidiaXineramaInfoOrder" "DFP-6"
    Option         "metamodes" "nvidia-auto-select +0+0"
    Option         "SLI" "Off"
    Option         "MultiGPU" "Off"
    Option         "BaseMosaic" "off"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Section "Screen"
    Identifier     "Screen1"
    Device         "Device1"
    Monitor        "Monitor1"
    DefaultDepth    24
    Option         "Stereo" "0"
    Option         "metamodes" "nvidia-auto-select +0+0 {AllowGSYNC=Off}"
    Option         "SLI" "Off"
    Option         "MultiGPU" "Off"
    Option         "BaseMosaic" "off"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

After rebooting, I still get GNOME on the one monitor. The other monitor, however, is a black screen with just the default X cursor (the glow on the right is just reflections on the monitor):

enter image description here

I also noticed two gdm3 sessions in htop, one running:

/usr/lib/xorg/Xorg vt2 -displayfd 3 -auth /run/user/1000/gdm/Xauthority -background none -noreset -keeptty -verbose 3

The other running the same command line but with vt1 instead of vt2. Killing the vt2 one killed my GNOME session. Killing the other one, however, seemed to do nothing. I can even still see a cursor on the second monitor.

Afaict from Settings | Devices | Screen Display, only one monitor is present:

enter image description here

Some additional data:

$ lspci | grep -i nvidia
04:00.0 VGA compatible controller: NVIDIA Corporation TU102 [GeForce RTX 2080 Ti Rev. A] (rev a1)
04:00.1 Audio device: NVIDIA Corporation TU102 High Definition Audio Controller (rev a1)
04:00.2 USB controller: NVIDIA Corporation TU102 USB 3.1 Controller (rev a1)
04:00.3 Serial bus controller [0c80]: NVIDIA Corporation TU102 UCSI Controller (rev a1)
0a:00.0 VGA compatible controller: NVIDIA Corporation TU102 [GeForce RTX 2080 Ti Rev. A] (rev a1)
0a:00.1 Audio device: NVIDIA Corporation TU102 High Definition Audio Controller (rev a1)
0a:00.2 USB controller: NVIDIA Corporation TU102 USB 3.1 Controller (rev a1)
0a:00.3 Serial bus controller [0c80]: NVIDIA Corporation TU102 UCSI Controller (rev a1)
$ xrandr -q
Screen 0: minimum 8 x 8, current 3840 x 2160, maximum 32767 x 32767
HDMI-0 disconnected (normal left inverted right x axis y axis)
DP-0 disconnected (normal left inverted right x axis y axis)
DP-1 disconnected (normal left inverted right x axis y axis)
DP-2 disconnected (normal left inverted right x axis y axis)
DP-3 disconnected (normal left inverted right x axis y axis)
HDMI-1 disconnected (normal left inverted right x axis y axis)
USB-C-0 connected primary 3840x2160+0+0 (normal left inverted right x axis y axis) 600mm x 340mm
   3840x2160     60.00*+  30.00  
   2560x1440     59.95  
   1920x1080     60.00    59.94  
   1600x900      60.00  
   1280x1024     60.02  
   1280x800      59.81  
   1280x720      60.00    59.94  
   1152x864      59.96  
   1024x768      60.00  
   800x600       60.32  
   720x480       59.94  
   640x480       59.94    59.93  
$ nvidia-smi
Sun Dec  8 14:19:03 2019       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 435.21       Driver Version: 435.21       CUDA Version: 10.1     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce RTX 208...  Off  | 00000000:04:00.0  On |                  N/A |
| 25%   32C    P8     6W / 260W |     39MiB / 11019MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
|   1  GeForce RTX 208...  Off  | 00000000:0A:00.0  On |                  N/A |
| 32%   41C    P8     4W / 260W |    571MiB / 11016MiB |      4%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0      7142      G   /usr/lib/xorg/Xorg                            37MiB |
|    1      7142      G   /usr/lib/xorg/Xorg                           268MiB |
|    1      7351      G   /usr/bin/gnome-shell                         260MiB |
|    1      9360      G   gnome-control-center                           6MiB |
|    1     10505      G   ...no-sandbox --gpu-preferences=IAAAAAAAAA    34MiB |
+-----------------------------------------------------------------------------+

Question: Why is only one of my monitors being picked up by GNOME and what can I do to fix this?

UPDATE: I’ve uploaded my /var/log/Xorg.0.log. No smoking gun there, afaict.


Get this bounty!!!

#StackBounty: #xorg #multiple-monitors #display #citrix Strange issue with Citrix remote desktop and dual monitor

Bounty: 100

Given the below:

  • Ubuntu 18.04
  • HP Compaq Pro 6300 SFF PC
  • 2 identical HP monitors

I have a dual monitor setup which works perfectly, apart from the Citrix remote desktop.

Citrix says that it detected multi-monitor support. In fact when I remote in to a full-screen session and then minimize the screen and resize, then I can see that the window Citrix created has the same size as the 2 monitors, but for some reason it is only presented on one of the monitors. (I.e. one monitor shows half of the remote session, the other half on the other monitor is always hidden.)

The PC has a VGA and a displayport output. One of the monitors is connected directly with VGA, the other with a displayport->vga adapter.

A strange thing is that no matter which display is set to be the primary display in gnome, Citrix always only shows itself on the monitor which is connected to the displayport output. The only difference is that if the one plugged into the displayport is set as primary, then citrix shows the primary section of the remote desktop (i.e. the one with the system tray), if the one plugged in the displayport is set as the secondary then citrix shows the secondary section of the remote desktop (which is normally an empty screen).

Normally this should work out of the box. Also no solutions to dual-monitor issues with citrix and linux I found on the web resolves this. Under Windows there are no issues with Citrix with the same setup.

Any idea?


Get this bounty!!!

#StackBounty: #xorg #mouse #vmware #logitech Configure scrolling using Logitech Trackball on VMWare

Bounty: 250

Background

A Windows 10 host is running VMWare Workstation Pro 15.1.0. The guest OS is running X11. The pointer hardware is a Logitech Marble Mouse having configuration information on the Ubuntu community site. On Windows, scrolling by holding the small right button works with TrackballScroll. The following image shows how xorg references Logitech’s buttons:

Logitech Marble Mouse Trackball

The VMWare .vmx file has the following configuration settings, which allows more than 3 different buttons to trigger mouse events in the guest OS:

usb.generic.allowHID = "TRUE"
mouse.vusb.enable = "TRUE"
mouse.vusb.useBasicMouse = "FALSE"

With these lines all mouse button events are sent to the guest OS.

The output from xinput list in the guest OS is:

xinput list 
⎡ Virtual core pointer                      id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ VMware VMware Virtual USB Mouse           id=7    [slave  pointer  (2)]
⎜   ↳ VMware VMware Virtual USB Mouse           id=8    [slave  pointer  (2)]
⎜   ↳ VirtualPS/2 VMware VMMouse                id=10   [slave  pointer  (2)]
⎜   ↳ VirtualPS/2 VMware VMMouse                id=11   [slave  pointer  (2)]

Running xinput test-xi2 --root details events for all four buttons 1, 8, 9, and 3 (from the above picture):

EVENT type 5 (ButtonRelease)
    device: 8 (8)
    detail: 1
EVENT type 5 (ButtonRelease)
    device: 8 (8)
    detail: 8
EVENT type 5 (ButtonRelease)
    device: 8 (8)
    detail: 9
EVENT type 5 (ButtonRelease)
    device: 8 (8)
    detail: 3

This shows that the button click events are being passed from the host to the guest successfully using device 8. Of slight concern is that there are two mice assigned the same name, but having different ids:

⎜   ↳ VMware VMware Virtual USB Mouse           id=7    [slave  pointer  (2)]
⎜   ↳ VMware VMware Virtual USB Mouse           id=8    [slave  pointer  (2)]

Problem

Scrolling by holding down the small right button (9) while moving the trackball fails. Running xinput test-xi2 --root shows the failure:

EVENT type 4 (ButtonPress)
    device: 8 (8)
    detail: 9
EVENT type 1 (DeviceChanged)
    device: 2 (7)
    reason: SlaveSwitch
    Reporting 7 classes:
        Class originated from: 7. Type: XIButtonClass
        Buttons supported: 11
X Error of failed request:  BadAtom (invalid Atom parameter)
  Major opcode of failed request:  17 (X_GetAtomName)
  Atom id in failed request:  0x282
  Serial number of failed request:  34
  Current serial number in output stream:  34
        Button labels: "Button Left" "Button Middle" "Button Right"

The file .../xorg.conf.d/50-trackball.conf configures X11 as follows:

Section "InputClass"
  Identifier    "Logitech Marble Mouse"
  MatchIsPointer "true"
  #MatchProduct  "Mouse"
  #MatchVendor   "VMWare"
  Driver        "libinput"
  Option        "ScrollMethod"        "button"
  Option        "ScrollButton"        "9"
  Option        "MiddleEmulation"     "true"
  Option        "HorizontalScrolling" "false"
  Option        "ButtonMapping"       "1 2 3 4 5 6 7 9 8"
EndSection

The output from xinput list-props 7 shows:

Device 'VMware VMware Virtual USB Mouse':
    Device Enabled (124):   1
    Coordinate Transformation Matrix (126): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
    libinput Calibration Matrix (261):  1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
    libinput Calibration Matrix Default (262):  1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
    libinput Natural Scrolling Enabled (263):   0
    libinput Natural Scrolling Enabled Default (264):   0
    libinput Send Events Modes Available (244): 1, 0
    libinput Send Events Mode Enabled (245):    0, 0
    libinput Send Events Mode Enabled Default (246):    0, 0
    libinput Left Handed Enabled (265): 0
    libinput Left Handed Enabled Default (266): 0
    libinput Scroll Methods Available (267):    0, 0, 1
    libinput Scroll Method Enabled (268):   0, 0, 1
    libinput Scroll Method Enabled Default (269):   0, 0, 1
    libinput Button Scrolling Button (270): 9
    libinput Button Scrolling Button Default (271): 2
    libinput Middle Emulation Enabled (272):    0
    libinput Middle Emulation Enabled Default (273):    0
    Device Node (247):  "/dev/input/event5"
    Device Product ID (248):    3599, 3
    libinput Drag Lock Buttons (274):   <no items>
    libinput Horizontal Scroll Enabled (275):   1

Question

What needs to change in the X Configuration File so that the small right button when held allows vertical scrolling using the trackball in an X11 session that’s running inside VMWare?

Related

Related links include:

Additional Details

Some extra information about attempts to resolve the problem and ways that work but are less than ideal.

Disconnect from Host

Note that it is possible to disconnect the mouse from the host OS by using the Connect option, which then permits scrolling as desired. The downside is that this makes switching between the guest and host systems a bit awkward in that it takes several steps to switch between systems. Ideally, the guest OS would use a single mouse click to give it focus, scrolling would “just work”, then Ctrl+Alt to release control back to the host OS.

Disconnect from Host

Changing Driver

Changing the driver from libinput to evdev does not work, such as:

  Driver        "evdev"

xinput

Even though VMWare lists two entries for the USB Mouse, id=8 does not appear to have any effect; whereas, id=7 can be disabled using:

xinput set-prop 7 124 0

Where 7 is the mouse ID, 124 is the Device Enabled setting, and 0 indicates false. This disables the pointer altogether; changing 0 to 1 re-enables the pointer.


Get this bounty!!!

#StackBounty: #xorg #window-manager #xcursor mwm cursor size

Bounty: 100

I have problems with cursor size on one of my Xorg screens on CentOS 7. I have two screens. One runs xfce4 window manager and desktop, while another runs mwm window manager. This is a custom setup, which allows a fullscreen Motif application to run on screen with mwm, and other apps on xfce4 screen. I also have special kind of monitor for Motif app, which is 2048×2048 resolution.

The problem I have is that all except one cursors are to big on mwm, while on xfce4 they are all normal. Cursor shaped “X” on desktop background is normal size while others are oversized.

Here’s a picture where an one of oversizeds cursor can be seen:
enter image description here

How can I change the size of cursors on mwm screen? I have tried Xcursor.size in Xresources, but with no effect.

Here are some more pictures showing cursor sizes.
enter image description here
enter image description here
enter image description here


Get this bounty!!!

#StackBounty: #18.04 #xorg #screen #vnc #display-manager Ubuntu 18.04 VNC/Vino stops refreshing when turning display off

Bounty: 50

After upgrading from 16.04 to 18.04 I’m having trouble with VNC/Vino.

I can connect via VNC (by enabling the built-in ‘Screen Sharing’ option), but as soon as I turn of the local display (server is connected to a TV, not a regular monitor), the VNC connection stops working for anything but the active windows. In other words: the background and the dock are not refreshed and the connection becomes very difficult to use (see screenshot).

Anyone has any idea where to look for a solution? I saw some posts about adding a dummy monitor, but that does not seem to apply to my case.
screenshot


Get this bounty!!!