为什么该udev规则在移除设备后不触发?
我有两只鼠标,其中一只鼠标中键和button6被同时触发。因此,我将我配置~/.Xmodmap为禁用此按钮。但是,与此同时,我希望其他鼠标仍然可以使用此按钮。因此,我写了一条udev规则,要求xmodmap根据所连接的鼠标来更改按钮的布局。 设定 这是我当前的设置: /etc/udev/rules.d/logitech-g7.rules: # deactivate MB 6 when mouse 1 is connected ACTION=="add", ENV{DEVTYPE}=="usb_device", ENV{ID_VENDOR_ID}=="046d", ENV{ID_MODEL_ID}=="c51a", RUN+="/home/user/.scripts/Troubleshooting/Bugfixes/mouseswitcher_wrapper 1", OWNER="user" # restore defaults when mouse 1 is disconnected ACTION=="remove", ENV{DEVTYPE}=="usb_device", ENV{ID_VENDOR_ID}=="046d", ENV{ID_MODEL_ID}=="c51a", RUN+="/home/user/.scripts/Troubleshooting/Bugfixes/mouseswitcher_wrapper 0", OWNER="user" /home/user/.scripts/疑难解答/修正/ mouseswitcher_wrapper: #!/bin/bash /home/user/.scripts/Troubleshooting/Bugfixes/mouseswitcher "$1"& /home/user/.scripts/问题排查/错误修复/ mouseswitcher #!/bin/bash sleep 1 DISPLAY=":0.0" HOME=/home/user/ XAUTHORITY=$HOME/.Xauthority export DISPLAY …