Add CapsLock and NumLock indicators to the status bar

This commit is contained in:
Ohad Livne 2025-07-02 17:35:38 +03:00
parent c403d9edd5
commit 03815a602f
Signed by: libohad-dev
GPG key ID: 34FDC68B51191A4D

View file

@ -7,6 +7,18 @@ else
recs="📽${recordings}"
fi
if [ "$(cat /sys/class/leds/input0::capslock/brightness)" = "1" ]; then
capslock="𝗔"
else
capslock="𝗮"
fi
if [ "$(cat /sys/class/leds/input0::numlock/brightness)" = "1" ]; then
numlock="🔢"
else
numlock="⮔"
fi
touchpad=$(swaymsg -t get_inputs | jq -r '[.[] | select(.type == "touchpad")][0] | .libinput.send_events')
if [ "${touchpad}" = "enabled" ]; then
touchpad_active="✅"
@ -97,4 +109,4 @@ case "${battery_state}" in
;;
esac
echo "${recs} 🕹️${touchpad_active} 📆${today} ${clock_face}${now} ${mike_symbol}${mike_volume}% ${audio_symbol}${audio_volume}% ${battery_symbol}${battery}%"
echo "${numlock}${capslock} ${recs} 🕹️${touchpad_active} 📆${today} ${clock_face}${now} ${mike_symbol}${mike_volume}% ${audio_symbol}${audio_volume}% ${battery_symbol}${battery}%"