aboutsummaryrefslogtreecommitdiff
path: root/leds
blob: 89c46c6fcc452503cc6d80145d1ababaa89dc113 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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