bspwm/examples/panel/panel_bar
Oliver Hope 9cbee375a9 Make colors work in panel_bar
I realised the colours weren't sourced, causing the bar not to work correctly.
2014-03-31 12:35:40 +01:00

61 lines
1.5 KiB
Bash
Executable file

#! /bin/sh
#
# Example panel for LemonBoy's bar
. panel_colors
while read -r line ; do
case $line in
S*)
# clock output
sys_infos="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG}${line#?}"
;;
T*)
# xtitle output
title="%{F$COLOR_TITLE_FG}%{B$COLOR_TITLE_BG}${line#?}"
;;
W*)
# bspwm internal state
wm_infos=""
IFS=':'
set -- ${line#?}
while [ $# -gt 0 ] ; do
item=$1
name=${item#?}
case $item in
O*)
# focused occupied desktop
wm_infos="$wm_infos %{F$COLOR_FOCUSED_OCCUPIED_FG}%{B$COLOR_FOCUSED_OCCUPIED_BG}%{U$COLOR_FOREGROUND}%{+u}${name}%{-u}"
;;
F*)
# focused free desktop
wm_infos="$wm_infos %{F$COLOR_FOCUSED_FREE_FG}%{B$COLOR_FOCUSED_FREE_BG}%{U$COLOR_FOREGROUND}%{+u}${name}%{-u}"
;;
U*)
# focused urgent desktop
wm_infos="$wm_infos %{F$COLOR_FOCUSED_URGENT_FG}%{B$COLOR_FOCUSED_URGENT_BG}%{U$COLOR_FOREGROUND}%{+u}${name}%{-u}"
;;
o*)
# occupied desktop
wm_infos="$wm_infos %{F$COLOR_OCCUPIED_FG}%{B$COLOR_OCCUPIED_BG}${name}"
;;
f*)
# free desktop
wm_infos="$wm_infos %{F$COLOR_FREE_FG}%{B$COLOR_FREE_BG}${name}"
;;
u*)
# urgent desktop
wm_infos="$wm_infos %{F$COLOR_URGENT_FG}%{B$COLOR_URGENT_BG}${name}"
;;
L*)
# layout
layout=$(printf "%s" "${name}" | sed 's/\(.\).*/\U\1/')
wm_infos="$wm_infos %{F$COLOR_LAYOUT_FG}%{B$COLOR_LAYOUT_BG}$layout"
;;
esac
shift
done
;;
esac
printf "%s\n" "%{l} $wm_infos %{c} $title %{r} $sys_infos "
done