cleaner bspwm bar module code

This commit is contained in:
Daniel Flanagan 2016-01-12 15:03:13 -06:00
parent 657c1c3068
commit 6ac712e06e
1 changed files with 7 additions and 22 deletions

View File

@ -25,43 +25,28 @@ bar_module_bspwm() {
name=${item#?} name=${item#?}
cname="$name" cname="$name"
case $item in case $item in
M*) O*) # focused occupied desktop
:
;;
m*)
:
;;
O*)
# focused occupied desktop
content="${content} %{F$COLOR_HIGHLIGHT}%{U$COLOR_HIGHLIGHT}%{+${ul}}${cname}%{-${ul}}%{U-}%{F-}" content="${content} %{F$COLOR_HIGHLIGHT}%{U$COLOR_HIGHLIGHT}%{+${ul}}${cname}%{-${ul}}%{U-}%{F-}"
;; ;;
F*) F*) # focused free desktop
# focused free desktop
content="${content} %{F$COLOR_DARK}%{U$COLOR_DARK}%{+${ul}}${cname}%{-${ul}}%{U-}%{F-}" content="${content} %{F$COLOR_DARK}%{U$COLOR_DARK}%{+${ul}}${cname}%{-${ul}}%{U-}%{F-}"
;; ;;
U*) U*) # focused occupied desktop
# focused occupied desktop
content="${content} %{F$COLOR_URGENT}%{U$COLOR_URGENT}%{+${ul}}${cname}%{-${ul}}%{U-}%{F-}" content="${content} %{F$COLOR_URGENT}%{U$COLOR_URGENT}%{+${ul}}${cname}%{-${ul}}%{U-}%{F-}"
;; ;;
o*) o*) # occupied desktop
# occupied desktop
content="${content} %{F$COLOR_FOREGROUND}${cname}%{F-}" content="${content} %{F$COLOR_FOREGROUND}${cname}%{F-}"
;; ;;
f*) f*) # free desktop
# free desktop
content="${content} %{F$COLOR_DARK}${cname}%{F-}" content="${content} %{F$COLOR_DARK}${cname}%{F-}"
;; ;;
u*) u*) # urgent desktop
# urgent desktop
content="${content} %{F$COLOR_URGENT}${cname}%{F-}" content="${content} %{F$COLOR_URGENT}${cname}%{F-}"
;; ;;
L*)
# layout
;;
esac esac
shift shift
done done
echo -e "$content%{F-}" echo -e "$content"
} }
export -f bar_module_bspwm export -f bar_module_bspwm
register_bar_module "$PRIORITY" "$MATCH" "bar_module_bspwm" register_bar_module "$PRIORITY" "$MATCH" "bar_module_bspwm"