Shell Script: TurnOff Key-Capsslock on Ubuntu
turnoff_key_CapsLock.sh
#!/bin/bash
echo -------------------------------------------
echo SCRIPT: "$(basename "$0")"
echo -------------------------------------------
BASEDIR=$(cd "$(dirname "$0")"; pwd -P) # for normal file
PIC=$BASEDIR/ClientAP-Wallpaper.png
KEY_CAPSLOCK_TURNOFF='00000002'
KEY_CAPSLOCK_TURNON='00000003'
###### MAIN ######
KEY_CAPSLOCK_STATE=$(xset q | grep LED | awk {'print $10'})
echo $KEY_CAPSLOCK_STATE
if [ "$KEY_CAPSLOCK_STATE" == "$KEY_CAPSLOCK_TURNON" ]
then
echo "Turn off KEY: CAPSLOCK."
xdotool key Caps_Lock
fi
No comments:
Post a Comment