aboutsummaryrefslogtreecommitdiff
path: root/tools/panel/panel_bar
diff options
context:
space:
mode:
authorVasil Zlatanov <vasil.zlatanov@gmail.com>2015-04-12 13:05:47 +0200
committerVasil Zlatanov <vasil.zlatanov@gmail.com>2015-04-12 13:05:47 +0200
commit47a0a3f433f820fc78d180884f6ca376fba97b73 (patch)
tree587b80062ebdb947d26ca7a70e32b38b7d67ca45 /tools/panel/panel_bar
parent269e617fea39658233db38ad503030c4fe040e80 (diff)
downloaddotfiles-47a0a3f433f820fc78d180884f6ca376fba97b73.tar.gz
dotfiles-47a0a3f433f820fc78d180884f6ca376fba97b73.tar.bz2
dotfiles-47a0a3f433f820fc78d180884f6ca376fba97b73.zip
Tidy up everything :)
Diffstat (limited to 'tools/panel/panel_bar')
-rwxr-xr-xtools/panel/panel_bar123
1 files changed, 123 insertions, 0 deletions
diff --git a/tools/panel/panel_bar b/tools/panel/panel_bar
new file mode 100755
index 0000000..0b2e55e
--- /dev/null
+++ b/tools/panel/panel_bar
@@ -0,0 +1,123 @@
+#! /bin/sh
+#
+# Example panel for LemonBoy's bar
+
+
+num_mon=$(bspc query -M | wc -l)
+
+source ./panel_colors
+while read -r line ; do
+ case $line in
+ C*)
+ cpu="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG} C:${line#?} %{B-}%{F-}"
+ ;;
+ R*)
+ ram="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG} R:${line#?} %{B-}%{F-}"
+ ;;
+
+# S*)
+# signal="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG} S:${line#?} %{B-}%{F-}"
+# ;;
+
+ p*)
+ # playing mpc
+ paused=''
+ playing="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG} p:${line#?} %{B-}%{F-}"
+ ;;
+
+ P*)
+ # paused mpc
+ playing=''
+ paused="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG} P:${line#?} %{B-}%{F-}"
+ ;;
+ K*)
+ # volume output
+ musicvol="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG} M:${line#?} %{B-}%{F-}"
+ ;;
+
+
+ B*)
+ # battery output
+ battery="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG} B:${line#?} %{B-}%{F-}"
+ ;;
+
+
+ V*)
+ # volume output
+ volume="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG} V:${line#?} %{B-}%{F-}"
+ ;;
+
+ E*)
+ # essid output
+ if [ -z ${line#?} ];then
+ essid="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG} E:No WiFi %{B-}%{F-}"
+ else
+ essid="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG} E:${line#?} %{B-}%{F-}"
+ fi
+ ;;
+
+ Z*)
+ # clock output
+ time_infos="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG} ${line#?} %{B-}%{F-}"
+ ;;
+ T*)
+ # xtitle output
+ title="%{F$COLOR_TITLE_FG}%{B$COLOR_TITLE_BG} ${line#?} %{B-}%{F-}"
+ ;;
+ W*)
+ # bspwm internal state
+ wm_infos=""
+ IFS=':'
+ set -- ${line#?}
+ while [ $# -gt 0 ] ; do
+ item=$1
+ name=${item#?}
+ case $item in
+ M*)
+ # active monitor
+ if [ $num_mon -gt 1 ] ; then
+ wm_infos="$wm_infos %{F$COLOR_FOCUSED_FG}%{B$COLOR_FOCUSED_BG} ${name} %{B-}%{F-} "
+ fi
+ ;;
+# m*)
+# # inactive monitor
+# if [ $num_mon -gt 1 ] ; then
+# wm_infos="$wm_infos %{F$COLOR_INACTIVE_MONITOR_FG}%{B$COLOR_INACTIVE_MONITOR_BG} ${name} %{B-}%{F-} "
+# fi
+# ;;
+ O*)
+ # focused occupied desktop
+ wm_infos="${wm_infos}%{F$COLOR_FOCUSED_FG}%{B$COLOR_FOCUSED_BG}%{U$COLOR_FOREGROUND} ${name} %{-u}%{B-}%{F-}"
+ ;;
+ F*)
+ # focused free desktop
+ wm_infos="${wm_infos}%{F$COLOR_FOCUSED_FG}%{B$COLOR_FOCUSED_BG}%{U$COLOR_FOREGROUND} ${name} %{-u}%{B-}%{F-}"
+ ;;
+ U*)
+ # focused urgent desktop
+ wm_infos="${wm_infos}%{F$COLOR_FOCUSED_FG}%{B$COLOR_FOCUSED_BG}%{U$COLOR_FOREGROUND} ${name} %{-u}%{B-}%{F-}"
+ ;;
+# o*)
+# # occupied desktop
+# wm_infos="${wm_infos}%{F$COLOR_OCCUPIED_FG}%{B$COLOR_OCCUPIED_BG} ${name} %{B-}%{F-}"
+# ;;
+# f*)
+# # free desktop
+# wm_infos="${wm_infos}%{F$COLOR_FREE_FG}%{B$COLOR_FREE_BG} ${name} %{B-}%{F-}"
+# ;;
+# u*)
+# # urgent desktop
+# wm_infos="${wm_infos}%{F$COLOR_URGENT_FG}%{B$COLOR_URGENT_BG} ${name} %{B-}%{F-}"
+# ;;
+# L*)
+# # layout
+# wm_infos="$wm_infos %{F$COLOR_LAYOUT_FG}%{B$COLOR_LAYOUT_BG} ${name} %{B-}%{F-}"
+# ;;
+ esac
+ shift
+ done
+ ;;
+ esac
+# printf "%s\n" "%{l}${wm_infos}${title}%{r}${playing}${paused}${cpu}${ram}${essid}${signal}${volume}${musicvol}${battery}${time_infos} "
+ printf "%s\n" "%{l}${wm_infos}${title}%{r}${playing}${paused}${cpu}${ram}${volume}${musicvol}${battery}${time_infos} "
+done