Guest User

Untitled

a guest
Sep 19th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. read TPdevice <<< $( xinput | sed -nre '/TouchPad/s/.*id=([0-9]*).*/\1/p' )
  4. state=$( xinput list-props "$TPdevice" | grep "Device Enabled" | grep -o "[01]$" )
  5.  
  6. if [ "$state" -eq '1' ];then
  7. xinput --disable "$TPdevice" && notify-send -i emblem-nowrite "Touchpad" "Disabled"
  8. else
  9. xinput --enable "$TPdevice" && notify-send -i input-touchpad "Touchpad" "Enabled"
  10. fi
Add Comment
Please, Sign In to add comment