Browse Source

Add suitable enviornment for rule

xinput needs DISPLAY and XAUTHORITY variables set to work.
fix-xinput-stdout
Ali Hatami Tajik 2 years ago
parent
commit
6577f79250
  1. 4
      src/rules/90-hid-mouse.rules

4
src/rules/90-hid-mouse.rules

@ -3,7 +3,9 @@
# insertion, removal. Actually, usb events are triggered when usb and
# usb interface are binding but hid is more specific and happen once for each
# action. change action is not used because
SUBSYSTEM=="hid", ACTION=="bind", RUN+="/usr/local/bin/changemouse.py"
# XAUTHORUTY and DISPLAY must be set and related to the current session. It may
# vary with different graphic drivers.
SUBSYSTEM=="hid", ENV{DISPLAY}=":0", ENV{XAUTHORITY}="/run/user/1000/gdm/Xauthority", ACTION=="bind", RUN+="/usr/local/bin/changemouse.py"
# the following line may not be needed as when we unplug a mouse it would
# automatically remove devices from the list and they need no furthur

Loading…
Cancel
Save