diff options
author | Vasil Zlatanov <vasil.zlatanov@gmail.com> | 2015-07-19 20:28:05 +0200 |
---|---|---|
committer | Vasil Zlatanov <vasil.zlatanov@gmail.com> | 2015-07-19 20:28:05 +0200 |
commit | 466ee41add2f57bc59eca1f7444ad122b97ff974 (patch) | |
tree | 2d873fe5419498ea9f0afccc4d314808c766b3d9 /tools/panel/panel_bar | |
parent | 12b654b02a3ba2b88194ed2582722bc92bf16361 (diff) | |
download | dotfiles-466ee41add2f57bc59eca1f7444ad122b97ff974.tar.gz dotfiles-466ee41add2f57bc59eca1f7444ad122b97ff974.tar.bz2 dotfiles-466ee41add2f57bc59eca1f7444ad122b97ff974.zip |
many updates
Diffstat (limited to 'tools/panel/panel_bar')
-rwxr-xr-x | tools/panel/panel_bar | 71 |
1 files changed, 61 insertions, 10 deletions
diff --git a/tools/panel/panel_bar b/tools/panel/panel_bar index 0b2e55e..779c5bb 100755 --- a/tools/panel/panel_bar +++ b/tools/panel/panel_bar @@ -6,14 +6,55 @@ num_mon=$(bspc query -M | wc -l) source ./panel_colors +source ./icons while read -r line ; do case $line in - C*) - cpu="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG} C:${line#?} %{B-}%{F-}" + Imail) + mbsync -a > /dev/null + if bspc control --get-status | grep OIX > /dev/null;then + mail='' + else + mail="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG} ${ICON_MAIL} %{B-}%{F-}" + fi ;; - R*) - ram="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG} R:${line#?} %{B-}%{F-}" + + Iface) + if bspc control --get-status | grep OX > /dev/null;then + face='' + else + face="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG} ${ICON_FACE} %{B-}%{F-}" + fi + ;; + + Ipub) + if bspc control --get-status | grep OX > /dev/null;then + pub='' + else + pub="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG} ${ICON_PUB} %{B-}%{F-}" + fi + ;; + + Ipriv) + if bspc control --get-status | grep OX > /dev/null;then + priv='' + else + priv="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG} ${ICON_PRIV} %{B-}%{F-}" + fi + ;; + Iclear) + priv="" + pub="" + face="" ;; + Ixlear) + mail='' + ;; +# 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-}" @@ -22,29 +63,39 @@ while read -r line ; do p*) # playing mpc paused='' - playing="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG} p:${line#?} %{B-}%{F-}" + playing="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG} ${ICON_PLAY} ${line#?} %{B-}%{F-}" ;; P*) # paused mpc playing='' - paused="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG} P:${line#?} %{B-}%{F-}" + paused="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG} ${ICON_PAUSE} ${line#?} %{B-}%{F-}" ;; K*) # volume output - musicvol="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG} M:${line#?} %{B-}%{F-}" + musicvol="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG} ${ICON_MUSIC} ${line#?} %{B-}%{F-}" ;; B*) # battery output - battery="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG} B:${line#?} %{B-}%{F-}" + if [[ ${line#?} =~ Discharging ]];then + percent=`echo ${line#?} | cut -d' ' -f2` + battery="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG} ${ICON_PWR} ${percent} %{B-}%{F-}"; + else + percent=`echo ${line#?} | cut -d' ' -f2` + battery="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG} ${ICON_PLUG} ${percent} %{B-}%{F-}"; + fi ;; V*) # volume output - volume="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG} V:${line#?} %{B-}%{F-}" + if amixer contents | head -12 | tail -1 | grep on > /dev/null;then + volume="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG} ${ICON_HPHONES} ${line#?} %{B-}%{F-}" + else + volume="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG} ${ICON_VOLUME_UP} ${line#?} %{B-}%{F-}"; + fi ;; E*) @@ -119,5 +170,5 @@ while read -r line ; do ;; 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} " + printf "%s\n" "%{l}${wm_infos}${title}%{r}${face}${priv}${pub}${mail}${playing}${paused}${cpu}${ram}${volume}${musicvol}${battery}${time_infos}" done |