Skip to content

Instantly share code, notes, and snippets.

@benmills
Created April 18, 2013 04:50
Show Gist options
  • Save benmills/5410214 to your computer and use it in GitHub Desktop.
Save benmills/5410214 to your computer and use it in GitHub Desktop.
Simple dzen panel for bspwm
#!/bin/bash
while true; do
if read line < $PANEL_FIFO; then
wm_status=""
IFS=':' read -a array <<< "$line"
for element in "${array[@]}"; do
if [[ $element =~ ^D ]]; then
wm_status="$wm_status ^fg(white)${element:1}"
elif [[ $element =~ ^d ]]; then
wm_status="$wm_status ^ca(1, bspc use ${element:1})^fg(darkgray)${element:1}^ca()"
elif [[ $element =~ ^E ]]; then
wm_status="$wm_status ^ca(1, bspc use ${element:1})^fg(#6b6b6b)${element:1}^ca()"
elif [[ $element =~ ^L ]]; then
wm_status="$wm_status • ^ca(1, bspc cycle_layout)^fg(white)${element:1}^ca()"
fi
done
echo $wm_status
fi
done
bspwm_dzen.sh | dzen2 -p -ta l
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment