X-Org 服务器 - 识别 USB 拔出事件

X-Org 服务器 - 识别 USB 拔出事件

在我们的 X-Org 服务器设置中,如果服务器正在运行并且我们拔下 USB 鼠标,那么服务器实际上不会执行任何操作(没有错误或警告)。如果我们重新插入设备,即使这样,服务器也无法识别该设备现在的存在,因为它仅在启动时查找该设备。我需要服务器妥善处理拔出事件,并且至少在拔下 USB 鼠标时退出。使用 shell,我如何识别 USB 鼠标是否已拔出?

我的 xorg 配置文件:

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

我们通过 docker 容器运行服务器。(PS:我是 X-Org 服务器的新手。)

相关内容