dotfiles/.i3blocks/keyindicator

15 lines
263 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
color="#515151"
fi
2019-09-09 20:04:37 +02:00
echo "${instance,*} <span foreground=\"$color\">█</span>"