diff options
author | Saumit Dinesan <justsaumit@protonmail.com> | 2022-05-25 20:51:06 +0530 |
---|---|---|
committer | Saumit Dinesan <justsaumit@protonmail.com> | 2022-05-25 20:51:06 +0530 |
commit | 3cd2a690fb007cc61b695fae131c31e14eeef062 (patch) | |
tree | b43ad72e5126e9489f0963b7efc164162c986375 /.scripts | |
parent | b28f181b97b19823e84414c5a2d7b1e959ffea98 (diff) |
better approach
Diffstat (limited to '.scripts')
-rwxr-xr-x | .scripts/kbesccaps | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/.scripts/kbesccaps b/.scripts/kbesccaps index d4978d6..b6b187c 100755 --- a/.scripts/kbesccaps +++ b/.scripts/kbesccaps @@ -4,7 +4,15 @@ ##whenever I plug in any of my keyboard (wired or wireless) #PreRequisite lsusb/usbutils -[ -z "command -v lsusb" ] && echo "Install usbutils" && exit +[ -z "$(command -v lsusb)" ] && echo "Install usbutils" && exit + +#for cronjob +export DISPLAY=:0 + +#If setxkbmap query string is of zero length +#then setxkbmap set caps lock as esc key +[[ -z "$(setxkbmap -query | grep "caps:escape")" ]] && setxkbmap -option caps:escape + +#[ -n "$(lsusb | grep -e 04f3:152e -e 25a7:fa67)" ] && setxkbmap -option caps:escape || exit -[[ 'lsusb | grep -e 04f3:152e -e 25a7:fa67' ]] && setxkbmap -option caps:escape |