dotfiles/.config/eww/bar/scripts/indicator

15 lines
293 B
Plaintext
Raw Normal View History

2022-03-25 17:10:57 +01:00
#!/bin/bash
query=$(xset q | grep -Po "(?:Caps|Num|Scroll)\s+Lock:\s*(\w*)" | grep -Po "(off|on)")
result=""
for i in $query
do
[ $i = "off" ] && result+="ﰊ "|| result+="ﰉ "
done
# somehow results are shown reversed. So i am reversing them here to fix it
echo $result | rev | xargs