Created
July 23, 2019 05:52
-
-
Save grim13b/235ea2f0e3868973b64d48c290e0e4ff to your computer and use it in GitHub Desktop.
タッチパットのON/OFFをトグル動作で制御する
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
device_id=$( xinput | grep -i touchpad | sed -nre '/Touchpad/s/.*id=([0-9]*).*/\1/p' ) | |
state=$( xinput list-props "$device_id" | grep -i "device enabled" | grep -o "[01]$" ) | |
if test $state = '1' | |
then | |
xinput disable "$device_id" && notify-send -i input-touchpad "Toggle Touchpad" "Disabled" | |
else | |
xinput enable "$device_id" && notify-send -i input-touchpad "Toggle Touchpad" "Enabled" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment