Created
May 13, 2017 14:40
-
-
Save airtonzanon/6499f1a7cd710732aed8213740824136 to your computer and use it in GitHub Desktop.
Keyboard Disable and Enable Toggle
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 | |
status=$(xinput list --long "AT Translated Set 2 keyboard" | grep "disabled") | |
if [[ "$status" =~ "disabled" ]] | |
then | |
echo "Enabling keyboard" | |
xinput enable "AT Translated Set 2 keyboard" | |
exit; | |
fi; | |
echo "Disabling keyboard" | |
xinput disable "AT Translated Set 2 keyboard" | |
exit; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment