Skip to content

Instantly share code, notes, and snippets.

@benmills
Created April 18, 2013 04:50

Revisions

  1. benmills created this gist Apr 18, 2013.
    21 changes: 21 additions & 0 deletions bspwm_dzen.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    #!/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
    1 change: 1 addition & 0 deletions usage.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    bspwm_dzen.sh | dzen2 -p -ta l