Attempt to udev better
This commit is contained in:
@@ -1,14 +1,17 @@
|
||||
#!/usr/bin/env bash
|
||||
set -o errexit
|
||||
set -o pipefail
|
||||
|
||||
main() {
|
||||
export RUNNING_AS="${RUNNING_AS:-me}"
|
||||
export RUNNING_AS_ID="$(id -u "${RUNNING_AS}")"
|
||||
export XINPUT_EXE="${XINPUT_EXE:=xinput}"
|
||||
export RUNNING_AS="${RUNNING_AS:-dan}"
|
||||
RUNNING_AS_ID="$(id -u "${RUNNING_AS}")"
|
||||
export RUNNING_AS_ID
|
||||
|
||||
export XAUTHORITY="/home/${RUNNING_AS}/.Xauthority"
|
||||
export XINPUT_EXE="${XINPUT_EXE:=xinput}"
|
||||
export XAUTHORITY="/run/user/${RUNNING_AS_ID}/gdm/Xauthority"
|
||||
export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/${RUNNING_AS_ID}/bus"
|
||||
export DISPLAY=:0
|
||||
: "${DISPLAY:=0}"
|
||||
export DISPLAY
|
||||
export HOME="/home/${RUNNING_AS}"
|
||||
|
||||
|
||||
@@ -25,8 +28,14 @@ main() {
|
||||
__get_prop_id "${device_id}" 'Scroll Method Enabled'
|
||||
)"
|
||||
|
||||
local scrollbutton
|
||||
scrollbutton="$(
|
||||
__get_prop_id "${device_id}" 'Button Scrolling Button'
|
||||
)"
|
||||
|
||||
__run_xinput_as set-prop "${device_id}" "${natscroll_enabled}" 1
|
||||
__run_xinput_as set-prop "${device_id}" "${scrollmeth_enabled}" 0 0 1
|
||||
__run_xinput_as set-prop "${device_id}" "${scrollbutton}" 8
|
||||
}
|
||||
|
||||
__get_device_id() {
|
||||
|
Reference in New Issue
Block a user