dotfiles/.i3blocks/keyindicator

15 lines
259 B
Text
Raw 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-11-06 01:59:52 +01:00
echo "<span foreground=\"$color\">${instance,*}</span>"