Created
February 13, 2015 00:52
-
-
Save jonlorusso/5fb6cab18b79e2dde684 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
focused="%{U#FFdd7380+u}----------%{U-}" | |
active="%{U#FF1b1b1b+u}----------%{U-}" | |
normal="%{U#FF4b4b4b+u}----------%{U-}" | |
desktops() { | |
desktops="" | |
for e in $(echo $1 | cut -d':' -f2-6 | tr ':' '\n') | |
do | |
if [ "${e:0:1}" == "O" ]; then | |
desktops="$desktops $focused" | |
elif [ "${e:0:1}" == "F" ]; then | |
desktops="$desktops $focused" | |
elif [ "${e:0:1}" == "o" ]; then | |
desktops="$desktops $active" | |
else | |
desktops="$desktops $normal" | |
fi | |
done | |
echo $desktops | |
} | |
bspc control --subscribe | \ | |
while read -r line ; do | |
# skip messages for other monitors | |
[ $( echo $line | grep "^WM$MONITOR" ) ] || continue | |
output=$(desktops $line) | |
echo "%{c}$output%{r}" | |
done | bar -bp -g "1366x18" -u 6 -F "#00000000" -B "#00000000" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment