Get the udev thing for trackman marble working
This commit is contained in:
parent
637107ed57
commit
fb3f33ed90
@ -2,13 +2,29 @@
|
||||
set -o errexit
|
||||
|
||||
main() {
|
||||
: "${DEVICE_ID:=Logitech USB Trackball}"
|
||||
export RUNNING_AS="${RUNNING_AS:-me}"
|
||||
export RUNNING_AS_ID="$(id -u "${RUNNING_AS}")"
|
||||
|
||||
export XAUTHORITY="/home/${RUNNING_AS}/.Xauthority"
|
||||
export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/${RUNNING_AS_ID}/bus"
|
||||
export DISPLAY=:0
|
||||
export HOME="/home/${RUNNING_AS}"
|
||||
|
||||
local device_id
|
||||
device_id="$(__get_device_id)"
|
||||
|
||||
# libinput Natural Scrolling Enabled (282)
|
||||
xinput set-prop "${DEVICE_ID}" 282 1
|
||||
/usr/bin/sudo -E -u "${RUNNING_AS}" \
|
||||
/usr/sbin/xinput set-prop "${device_id}" 282 1
|
||||
|
||||
# libinput Scroll Method Enabled (285)
|
||||
xinput set-prop "${DEVICE_ID}" 285 0 0 1
|
||||
/usr/bin/sudo -E -u "${RUNNING_AS}" \
|
||||
/usr/sbin/xinput set-prop "${device_id}" 285 0 0 1
|
||||
}
|
||||
|
||||
__get_device_id() {
|
||||
/usr/bin/sudo -E -u "${RUNNING_AS}" /usr/sbin/xinput list |
|
||||
awk '/Logitech USB Trackball/ { sub(/id=/, "", $6); print $6 }'
|
||||
}
|
||||
|
||||
main "${@}"
|
||||
|
@ -1 +1 @@
|
||||
SUBSYSTEM=="usb", ENV{ID_VENDOR}=="Logitech", ENV{ID_SERIAL}=="Logitech_USB_Trackball", RUN+="/home/me/.udev/handle-trackman-marble"
|
||||
ACTION=="bind", SUBSYSTEM=="usb", ENV{ID_VENDOR}=="Logitech", ENV{ID_SERIAL}=="Logitech_USB_Trackball", RUN:="/home/me/.udev/handle-trackman-marble"
|
||||
|
Loading…
Reference in New Issue
Block a user