]> gitweb.fluxo.info Git - scripts.git/commitdiff
Adding leds script
authorSilvio Rhatto <rhatto@riseup.net>
Thu, 21 Feb 2013 22:41:35 +0000 (19:41 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Thu, 21 Feb 2013 22:41:35 +0000 (19:41 -0300)
leds [new file with mode: 0755]

diff --git a/leds b/leds
new file mode 100755 (executable)
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