mirror of
https://github.com/fscotto/infra.git
synced 2026-05-30 15:39:58 +00:00
17 lines
335 B
Bash
Executable File
17 lines
335 B
Bash
Executable File
#!/bin/sh
|
|
|
|
state="$(xset q 2>/dev/null)"
|
|
|
|
caps="$(printf '%s\n' "$state" | grep 'Caps Lock:' | awk '{print $4}')"
|
|
num="$(printf '%s\n' "$state" | grep 'Num Lock:' | awk '{print $8}')"
|
|
|
|
out=""
|
|
|
|
[ "$caps" = "on" ] && out="${out} CAPS"
|
|
[ "$num" = "on" ] && out="${out} NUM"
|
|
|
|
[ -n "$out" ] || exit 0
|
|
|
|
echo "$out"
|
|
echo "$out"
|
|
echo "#9a9a9a" |