diff options
Diffstat (limited to 'bspwm/panel_bar')
-rwxr-xr-x | bspwm/panel_bar | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/bspwm/panel_bar b/bspwm/panel_bar new file mode 100755 index 0000000..72e7629 --- /dev/null +++ b/bspwm/panel_bar @@ -0,0 +1,96 @@ +#! /bin/sh + +#. panel_colors + +n_monitors=$(bspc query -M | wc -l) + +while read -r line ; do + case $line in + S*) + # Clock + sys_info="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG}${line#?}%{B-}%{F-}" + ;; + T*) + # Title + title="%{F$COLOR_TITLE_FG}%{B$COLOR_TITLE_BG}${line#?}%{B-}%{F-}" + ;; + I*) + # IO + io_info="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG}${line#?}%{B-}%{F-}" + ;; + B*) + # Battery + bat_info="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG} ${line#?} %{B-}%{F-}" + ;; + C*) + # CPU temperature + temp_info="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG}${line#?}°%{B-}%{F-}" + ;; + L*) + # CPU load + load_info="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG}${line#?}%%{B-}%{F-}" + ;; + M*) + # Memory usage + mem_info="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG}${line#?}%{B-}%{F-}" + ;; + N*) + # Network throughput + net_info="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG}${line#?}%{B-}%{F-}" + ;; + W*) + # Window manager state + wm_info="" + IFS=':' + set -- ${line#?} + while [ $# -gt 0 ] ; do + item=$1 + name=${item#?} + case $item in + M*) + # active monitor + if [ $n_monitors -gt 1 ] ; then + wm_info="$wm_info %{F$COLOR_ACTIVE_MONITOR_FG}%{B$COLOR_ACTIVE_MONITOR_BG}${name} %{B-}%{F-} " + fi + ;; + m*) + # inactive monitor + if [ $n_monitors -gt 1 ] ; then + wm_info="$wm_info %{F$COLOR_INACTIVE_MONITOR_FG}%{B$COLOR_INACTIVE_MONITOR_BG}${name}%{B-}%{F-} " + fi + ;; + O*) + # focused occupied desktop + wm_info="${wm_info}%{F$COLOR_FOCUSED_OCCUPIED_FG}%{B$COLOR_FOCUSED_OCCUPIED_BG}%{U$COLOR_FOREGROUND}%{+u}${name}%{-u}%{B-}%{F-} " + ;; + F*) + # focused free desktop + wm_info="${wm_info}%{F$COLOR_FOCUSED_FREE_FG}%{B$COLOR_FOCUSED_FREE_BG}%{U$COLOR_FOREGROUND}%{+u}${name}%{-u}%{B-}%{F-} " + ;; + U*) + # focused urgent desktop + wm_info="${wm_info}%{F$COLOR_FOCUSED_URGENT_FG}%{B$COLOR_FOCUSED_URGENT_BG}%{U$COLOR_FOREGROUND}%{+u}${name}%{-u}%{B-}%{F-} " + ;; + o*) + # occupied desktop + wm_info="${wm_info}%{F$COLOR_OCCUPIED_FG}%{B$COLOR_OCCUPIED_BG}${name}%{B-}%{F-} " + ;; + f*) + # free desktop + wm_info="${wm_info}%{F$COLOR_FREE_FG}%{B$COLOR_FREE_BG}${name}%{B-}%{F-} " + ;; + u*) + # urgent desktop + wm_info="${wm_info}%{F$COLOR_URGENT_FG}%{B$COLOR_URGENT_BG}${name}%{B-}%{F-} " + ;; + L*) + # layout + #wm_info="$wm_info %{F$COLOR_LAYOUT_FG}%{B$COLOR_LAYOUT_BG} ${name} %{B-}%{F-}" + ;; + esac + shift + done + ;; + esac + printf "%s\n" "%{l}${wm_info} : ${load_info} ${temp_info} : ${mem_info} :${io_info} : ${net_info}%{c} ${title} %{r} ${bat_info}${sys_info}" +done |