Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
MonsterWM init script
while read -t 60 -r wmout || true; do
unset up
unset music
up=[$(checkupdates | wc -l)]
if [[ $wmout =~ ^(([[:digit:]]+:)+[[:digit:]]+ ?)+$ ]]; then
unset r
read -ra desktops <<< "$wmout"
for desktop in "${desktops[@]}"; do
IFS=':' read -r d w m c u <<< "$desktop"
((c)) && fg="1" bg="0" lc="\u1 " rc=" \ur" i="${ms[$m]}" || fg="8" bg="0" lc=" " rc=" "
((w)) && ((! c)) && fg="1" bg="0" lc="\ur " rc=" \ur"
((u)) && fg="7" bg="0" lc="\u7 " rc=" \ur"
printf "\\\l%s\\\r%s\n" "$r \r\f2\b0$music \f6\b0$up \f5\b0$i" "$(date "+\c\f3\b0 %I:%M") "
done < "$ff" | bar &
monsterwm > "$ff"
rm $ff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment