os/arch (lemonbar): rethink (and simplify) layout

This commit is contained in:
Henrik Lissner 2017-01-03 03:50:23 -05:00
parent 12a5de6de3
commit e44825c951

View file

@ -25,7 +25,7 @@ echo "MKFIFO $PANEL_FIFO"
# Bootstrap panel(s) # Bootstrap panel(s)
# #
clock -sf "T${ICON_DATE} %A, %b %d ${ICON_TIME} %I:%M %p" > "${PANEL_FIFO}" & clock -sf "D%A, %b %d %I:%M %p" > "${PANEL_FIFO}" &
xtitle -sf 'X%s' > "${PANEL_FIFO}" & xtitle -sf 'X%s' > "${PANEL_FIFO}" &
bspc subscribe report > "${PANEL_FIFO}" & bspc subscribe report > "${PANEL_FIFO}" &
@ -43,26 +43,19 @@ parse() {
data="${line#?}" data="${line#?}"
case $line in case $line in
# Minimal icons # Minimal icons
B*) battery="$data" B*) battery=" $data " ;;
;; U*) updates=" $data " ;;
U*) updates=" $data" M*) mail=" $data " ;;
;; V*) vol=" %{A:vol toggle:}$data${A} " ;;
M*) mail=" $data" I*) wifi=" $data " ;;
;; I*) wifi=" $data " ;;
V*) vol=" %{A:vol toggle:}$data${A}"
;;
I*) wifi=" $data"
;;
# Full segments # Full segments
X*) xtitle="$data" X*) xtitle="$data" ;;
;; D*) datetime=" $data " ;;
T*) datetime=" $data" S*) song="$data " ;;
;;
S*) song="$data "
;;
W*) # bspwm's state W*) # bspwm's state
wm="" wm=
IFS=':' IFS=':'
set -- $data set -- $data
while [ "$#" -gt 0 ] while [ "$#" -gt 0 ]
@ -88,39 +81,18 @@ parse() {
;; ;;
[fFoOuU]*) [fFoOuU]*)
if [[ $M ]]; then if [[ $M ]]; then
icon="$ICON_NONE" icon="$ICON_FULL"
case $id in case $id in
f*) # free desktop f*) _FG=$COLOR_FREE_FG icon="$ICON_NONE" ;; # free desktop
_FG=$COLOR_FREE_FG F*) _FG=$COLOR_FOCUSED_FREE_FG icon="$ICON_NONE" ;; # focused free desktop
_BG=$COLOR_FREE_BG o*) _FG=$COLOR_OCCUPIED_FG ;; # occupied desktop
;; O*) _FG=$COLOR_FOCUSED_OCCUPIED_FG ;; # focused occupied desktop
F*) # focused free desktop u*) _FG=$COLOR_URGENT_FG ;; # urgent desktop
_FG=$COLOR_FOCUSED_FREE_FG U*) _FG=$COLOR_FOCUSED_URGENT_FG ;; # focused urgent desktop
_BG=$COLOR_FOCUSED_FREE_BG
;;
o*) # occupied desktop
_FG=$COLOR_OCCUPIED_FG
_BG=$COLOR_OCCUPIED_BG
icon="$ICON_FULL"
;;
O*) # focused occupied desktop
_FG=$COLOR_FOCUSED_OCCUPIED_FG
_BG=$COLOR_FOCUSED_OCCUPIED_BG
icon="$ICON_FULL"
;;
u*) # urgent desktop
_FG=$COLOR_URGENT_FG
_BG=$COLOR_URGENT_BG
icon="$ICON_FULL"
;;
U*) # focused urgent desktop
_FG=$COLOR_FOCUSED_URGENT_FG
_BG=$COLOR_FOCUSED_URGENT_BG
icon="$ICON_FULL"
;;
esac esac
# eval "icon=\$ICON_$(echo ${name#??} | tr '[:lower:]' '[:upper:]')" eval "icon=\$ICON_$(echo ${name#??})"
wm="${wm}%{F$_FG}%{B$_BG}%{A:bspc desktop -f ${name}:} ${icon:-$name} %{A}%{B-}%{F-}" # wm="${wm}%{F$_FG}%{A:bspc desktop -f ${name}:} ${icon:-$name} %{A}%{F-}"
wm="${wm}%{F$_FG}%{A:bspc desktop -f ${name}:} ${icon:-$name} %{A}%{B-}%{F-}"
fi fi
;; ;;
esac esac
@ -129,8 +101,8 @@ parse() {
;; ;;
esac esac
echo -e \ echo -e \
"%{l}${wm}${song}" \ "%{l} ${xtitle}${song}" \
"%{c}${xtitle}" \ "%{c}${wm}" \
"%{r}${battery}${mail}${updates}${vol}${wifi} ${datetime}" "%{r}${battery}${mail}${updates}${vol}${wifi} ${datetime}"
done done
} }