Skip to content

Instantly share code, notes, and snippets.

@seppo0010
Last active June 18, 2020 10:45
Show Gist options
  • Save seppo0010/be9adc8f6cf7852c711085906c039ac0 to your computer and use it in GitHub Desktop.
Save seppo0010/be9adc8f6cf7852c711085906c039ac0 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
set -Eeu
action=disable
[ -n "${1:-}" ] && action=enable
devices() { cat<<EOF; }
Sleep Button
Power Button
DELL0927:00 044E:1220 Touchpad
DELL0927:00 044E:1220 Mouse
AT Translated Set 2 keyboard
EOF
pr -tm <(xinput --list --id-only) <(xinput --list --name-only) | grep -f <(devices) | while read device _; do
xinput --$action $device
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment