aboutsummaryrefslogtreecommitdiff
path: root/leds
blob: 22ff769f0a9328c5b0790edf80b23eb2a63eaee0 (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