summaryrefslogtreecommitdiff
path: root/.scripts/kbesccaps
diff options
context:
space:
mode:
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