dotfiles/.i3blocks/keyindicator
2020-12-31 11:14:20 +01:00

16 lines
291 B
Bash
Executable file

#!/bin/bash
[[ -z "$instance" ]] && instance=Caps
status=$(xset q | grep -Po "$instance Lock: +(on|off)" | grep -Po "on|off")
if [[ "$status" = "on" ]]
then
color="#99CC99"
else
color="#747369"
fi
instance=${instance//Caps/Maj}
echo "<span foreground=\"$color\">${instance,*}</span>"