aboutsummaryrefslogtreecommitdiff
path: root/leds
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2014-09-18 16:38:30 -0300
committerSilvio Rhatto <user@example.org>2014-09-18 16:38:30 -0300
commit9181c40eae371a758a68db47a79b124cf4141986 (patch)
treed1ade9808bf715a7b47e8a976a15e761b1ec1939 /leds
downloadutils-x11-9181c40eae371a758a68db47a79b124cf4141986.tar.gz
utils-x11-9181c40eae371a758a68db47a79b124cf4141986.tar.bz2
Initial import
Diffstat (limited to 'leds')
-rwxr-xr-xleds25
1 files changed, 25 insertions, 0 deletions
diff --git a/leds b/leds
new file mode 100755
index 0000000..22ff769
--- /dev/null
+++ b/leds
@@ -0,0 +1,25 @@
+#! /bin/bash
+#
+# Get keyboard led state.
+# See https://bbs.archlinux.org/viewtopic.php?id=68511
+#
+
+ledstate="`xset q 2>/dev/null | grep LED`"
+ledstate="`echo $ledstate | sed s/[^1-9]//g`"
+case "$ledstate" in
+ '1')
+ echo "[CapsLock] "
+ ;;
+ '2')
+ # Right now we're not interested on NumLock status
+ #echo "[NumLock]"
+ echo ""
+ ;;
+ '3')
+ # Right now we're not interested on NumLock status
+ #echo "[CapsLock][NumLock]"
+ echo "[CapsLock] "
+ ;;
+ *)
+ echo ""
+esac