Skip to content

Instantly share code, notes, and snippets.

@airtonzanon
Created May 13, 2017 14:40
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 airtonzanon/6499f1a7cd710732aed8213740824136 to your computer and use it in GitHub Desktop.
Save airtonzanon/6499f1a7cd710732aed8213740824136 to your computer and use it in GitHub Desktop.
Keyboard Disable and Enable Toggle
#!/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