dotfiles/.i3blocks/keyindicator

17 lines
291 B
Text
Raw Permalink Normal View History

2019-09-09 20:04:37 +02:00
#!/bin/bash
2019-09-09 20:04:37 +02:00
[[ -z "$instance" ]] && instance=Caps
2019-09-09 20:04:37 +02:00
status=$(xset q | grep -Po "$instance Lock: +(on|off)" | grep -Po "on|off")
2019-09-09 20:04:37 +02:00
if [[ "$status" = "on" ]]
then
color="#99CC99"
else
2020-11-06 01:59:52 +01:00
color="#747369"
2019-09-09 20:04:37 +02:00
fi
2020-12-31 11:14:20 +01:00
instance=${instance//Caps/Maj}
2020-11-06 01:59:52 +01:00
echo "<span foreground=\"$color\">${instance,*}</span>"