-
-
Save dmishh/6990377 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# Add ’alias key='~/key.sh'’ to .bashrc or .zshrc | |
case "$1" in | |
"off") echo "Keyboard is temporary disabled" | |
sudo kextunload /System/Library/Extensions/AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyboard.kext/ > /dev/null 2>&1 | |
;; | |
"on") echo "Keyboard is enabled again" | |
sudo kextload /System/Library/Extensions/AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyboard.kext/ > /dev/null 2>&1 | |
;; | |
"easy") echo "Keyboard is temporary disabled. Press ’any key’ ;) to enable" | |
sudo kextunload /System/Library/Extensions/AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyboard.kext/ > /dev/null 2>&1 | |
read -n 1 -s | |
sudo kextload /System/Library/Extensions/AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyboard.kext/ > /dev/null 2>&1 | |
;; | |
*) echo "Use 'on'/'off' or 'easy' commands!" | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment