fixed formatting

This commit is contained in:
2017-03-25 08:57:12 +02:00
parent 93d063bbbf
commit cf38eb4ace

View File

@@ -10,8 +10,8 @@ COLOR_GREY2="#a7a5a5"
COLOR_GREY3="#504e4e" COLOR_GREY3="#504e4e"
if xdo id -a "$PANEL_WM_NAME" > /dev/null ; then if xdo id -a "$PANEL_WM_NAME" > /dev/null ; then
printf "%s\n" "The panel is already running." >&2 printf "%s\n" "The panel is already running." >&2
exit 1 exit 1
fi fi
trap 'trap - TERM; kill 0' INT TERM QUIT EXIT trap 'trap - TERM; kill 0' INT TERM QUIT EXIT
@@ -26,59 +26,59 @@ bspc config top_padding $PANEL_HEIGHT
bspc subscribe report > "$PANEL_FIFO" & bspc subscribe report > "$PANEL_FIFO" &
while read -r line ; do while read -r line ; do
case $line in case $line in
S*) S*)
# conky output # conky output
sys="${line#?}" sys="${line#?}"
;; ;;
W*) W*)
# bspwm's state # bspwm's state
wm="" wm=""
IFS=':' IFS=':'
mon=0 mon=0
set -- ${line#?} set -- ${line#?}
while [ $# -gt 0 ] ; do while [ $# -gt 0 ] ; do
item=$1 item=$1
name=${item#?} name=${item#?}
case $item in case $item in
[mM]*) [mM]*)
if [ $num_mon -ge 2 ]; then if [ $num_mon -ge 2 ]; then
mon=$((mon+1)) mon=$((mon+1))
if [ $mon -gt 1 ]; then if [ $mon -gt 1 ]; then
wm="${wm}%{F${COLOR_GREY2}}%{B${COLOR_BLACK}};" wm="${wm}%{F${COLOR_GREY2}}%{B${COLOR_BLACK}};"
fi fi
fi fi
;; ;;
[fFoOuU]*) [fFoOuU]*)
case $item in case $item in
f*) f*)
# free desktop # free desktop
FG=$COLOR_GREY2 FG=$COLOR_GREY2
BG=$COLOR_BLACK BG=$COLOR_BLACK
;; ;;
F*) F*)
# focused free desktop # focused free desktop
FG=$COLOR_GREY1 FG=$COLOR_GREY1
BG=$COLOR_GREY3 BG=$COLOR_GREY3
;; ;;
o*) o*)
# occupied desktop # occupied desktop
FG=$COLOR_GREY2 FG=$COLOR_GREY2
BG=$COLOR_BLACK BG=$COLOR_BLACK
;; ;;
O*) O*)
# focused occupied desktop # focused occupied desktop
FG=$COLOR_GREY1 FG=$COLOR_GREY1
BG=$COLOR_GREY3 BG=$COLOR_GREY3
;; ;;
esac esac
wm="${wm}%{F${COLOR_GREY2}}%{B${BG}}%{F${FG}}%{A:bspc desktop -f ${name}:} ${name}%{A}%{F${BG}}%{B${COLOR_GREY2}}" wm="${wm}%{F${COLOR_GREY2}}%{B${BG}}%{F${FG}}%{A:bspc desktop -f ${name}:} ${name}%{A}%{F${BG}}%{B${COLOR_GREY2}}"
;; ;;
esac esac
shift shift
done done
;; ;;
esac esac
while IFS=';' read -ra array; do while IFS=';' read -ra array; do
bar="" bar=""