Skip to content

Instantly share code, notes, and snippets.

@cab404
Created February 2, 2018 09:14
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 cab404/1a09bc6fa3f1c9dbbf37ba71af37b8d0 to your computer and use it in GitHub Desktop.
Save cab404/1a09bc6fa3f1c9dbbf37ba71af37b8d0 to your computer and use it in GitHub Desktop.
#!/bin/bash
id=$(xinput list --id-only "SynPS/2 Synaptics TouchPad")
is_on=$(xinput list-props $id | grep "Device Enabled" | tail -c 2 | grep 1)
echo $is_on
if (( $is_on ))
then
state=0;
text="touchpad [off]"
else
state=1;
text="touchpad [on]"
fi
eval 'xinput set-prop $id "Device Enabled" $state';
# zenity --notification --text="$text" --hint=transient:true
notify-send "$text"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment