Skip to content

Instantly share code, notes, and snippets.

@phackwer
Forked from v-dimitrov/touchpad-fix
Created December 5, 2021 01:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phackwer/6b3862cf536ab517fa02bfd46a6afc41 to your computer and use it in GitHub Desktop.
Save phackwer/6b3862cf536ab517fa02bfd46a6afc41 to your computer and use it in GitHub Desktop.
touchpad fn key fix
#!/bin/sh
# toggle touch pad
device=`xinput list --name-only | grep -i touchpad`
isOn=`xinput list-props "$device" | grep -i enabled | tail -c 2`
iconEnabled='input-touchpad-symbolic'
iconDisabled='touchpad-disabled-symbolic'
case "$isOn" in
0)
notify-send --icon=$iconEnabled "Touchpad [ON]" "Your touchpad is now enabled"
xinput set-prop "$device" 'Device Enabled' 1
;;
1)
notify-send --icon=$iconDisabled "Touchpad [OFF]" "Your touchpad is now disabled"
xinput set-prop "$device" 'Device Enabled' 0
;;
*)
notify-send --icon=$iconEnabled --expire-time=10000 "Error: Touchpad device enabled says: $isOn."
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment