aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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