0

In our X-Org server setup, if the server is running and we unplug the USB Mouse then the server doesn't really do anything (no errors or warnings.) If we replug the device, even then the server doesn't recognize that device is there now, since it looks for the device only on startup. I need the server to handle the unplug event gracefully and, at the least, exit if the USB mouse has unplugged. Using shell, how can I identify if the USB Mouse has unplugged?

My xorg config file:

Section "ServerFlags"
    Option "AutoAddDevices" "no"
    Option "DontVTSwitch"   "yes"
    Option "DontZap"        "yes"
    Option "BlankTime"      "off"
    Option "StandbyTime"    "off"
    Option "SuspendTime"    "off"
    Option "OffTime"        "off"
    Option "NoPM"           "yes"
    Option "AllowMouseOpenFail" "yes"
EndSection

Section "InputDevice"
    Identifier "Touchscreen"
    Option "CorePointer"
    Driver "evdev"
    Option "Device" "/dev/input/by-id/usb-ILITEK_ILITEK-TP-event-if00"
    Option "Mode" "Absolute"
EndSection

Section "ServerLayout"
    Identifier "Layout"
    InputDevice "Touchscreen" "CorePointer"
    #InputDevice "Keyboard0" "CoreKeyboard"
EndSection

We run the server via a docker container. (P.S.: I am new to X-Org server.)

Beenish Khan
  • 101
  • 4
  • Why have you specified a device in the Xorg configuration? Please specify also your Linux distribution and the method by which you created this Docker container. – Michael Hampton Mar 01 '19 at 20:00
  • So this was setup by somebody else, I am just looking into the USB issue. We are using Ubuntu 16.04. The docker container can be created via the normal `docker run` command. Question : If we leave it to auto detect, can it auto detect apart from at the startup time ? – Beenish Khan Mar 01 '19 at 20:15
  • AutoAddDevices no will certainly get in the way too (and that's probably why the device had to be specified) – A.B Mar 01 '19 at 22:55
  • So apparently 'AutoAddDevices' don't work in docker because of how udev interacts with Xorg – Beenish Khan Mar 04 '19 at 18:22

0 Answers0