summaryrefslogtreecommitdiff
path: root/.scripts/kbesccaps
diff options
context:
space:
mode:
authorSaumit Dinesan <justsaumit@protonmail.com>2022-05-25 20:51:06 +0530
committerSaumit Dinesan <justsaumit@protonmail.com>2022-05-25 20:51:06 +0530
commit3cd2a690fb007cc61b695fae131c31e14eeef062 (patch)
treeb43ad72e5126e9489f0963b7efc164162c986375 /.scripts/kbesccaps
parentb28f181b97b19823e84414c5a2d7b1e959ffea98 (diff)
better approach
Diffstat (limited to '.scripts/kbesccaps')
-rwxr-xr-x.scripts/kbesccaps12
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