aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2013-02-21 19:41:35 -0300
committerSilvio Rhatto <rhatto@riseup.net>2013-02-21 19:41:35 -0300
commit4f06899111090b694b2e441495f9a1c521e4708c (patch)
treead4b7ce7081fc82be4f3c13595d6714a16517b31
parent240bcdd451b9cd0ca64185b77bab6bd0f54d1a12 (diff)
downloadscripts-4f06899111090b694b2e441495f9a1c521e4708c.tar.gz
scripts-4f06899111090b694b2e441495f9a1c521e4708c.tar.bz2
Adding leds script
-rwxr-xr-xleds21
1 files changed, 21 insertions, 0 deletions
diff --git a/leds b/leds
new file mode 100755
index 0000000..40c8392
--- /dev/null
+++ b/leds
@@ -0,0 +1,21 @@
+#! /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 "C."
+ ;;
+ '2')
+ echo ".N"
+ ;;
+ '3')
+ echo "CN"
+ ;;
+ *)
+ echo ".."
+esac