-
-
Save dmishh/6992365 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") sudo kextunload /System/Library/Extensions/AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyboard.kext/ > /dev/null 2>&1 | |
echo "Keyboard is temporary disabled" | |
;; | |
"on") sudo kextload /System/Library/Extensions/AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyboard.kext/ > /dev/null 2>&1 | |
echo "Keyboard is enabled again" | |
;; | |
"easy") sudo -K | |
sudo kextunload /System/Library/Extensions/AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyboard.kext/ > /dev/null 2>&1 | |
echo "Keyboard is temporary disabled. Press ’any key’ ;) to enable" | |
read -n 1 -s | |
sudo kextload /System/Library/Extensions/AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyboard.kext/ > /dev/null 2>&1 | |
sudo -k | |
echo "Keyboard is enabled again" | |
;; | |
*) echo "Use 'on'/'off' or 'easy' commands!" | |
;; | |
esac | |
sudo -k |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment