From 466ee41add2f57bc59eca1f7444ad122b97ff974 Mon Sep 17 00:00:00 2001 From: Vasil Zlatanov Date: Sun, 19 Jul 2015 20:28:05 +0200 Subject: many updates --- tools/panel/panel | 10 +++++--- tools/panel/panel_bar | 71 +++++++++++++++++++++++++++++++++++++++++++-------- tools/panel/profile | 7 +++-- 3 files changed, 72 insertions(+), 16 deletions(-) mode change 100644 => 100755 tools/panel/profile (limited to 'tools/panel') diff --git a/tools/panel/panel b/tools/panel/panel index a9e5567..472b180 100755 --- a/tools/panel/panel +++ b/tools/panel/panel @@ -4,23 +4,25 @@ source ./profile source ~/.colors [ -e "$PANEL_FIFO" ] && rm "$PANEL_FIFO" -mkfifo "$PANEL_FIFO" +mkfifo -m 777 "$PANEL_FIFO" + bspc config top_padding $PANEL_HEIGHT bspc control --subscribe > "$PANEL_FIFO" & xtitle -sf 'T%s' > "$PANEL_FIFO" & volume -f 'V%i' > "$PANEL_FIFO" & -battery -i 60 -sf 'B%i' > "$PANEL_FIFO" & +battery -i 60 -sf 'B%s %i' > "$PANEL_FIFO" & clock -i 60 -sf 'Z%d %a %H:%M' > "$PANEL_FIFO" & ./music > "$PANEL_FIFO" & #./load > "$PANEL_FIFO" & #essid -sf 'E%s' -i 30 -w wlp2s0 > "$PANEL_FIFO" & # ./signal > "$PANEL_FIFO" & +unbuffer alsactl monitor | grep --line-buffered 'Headphone Jack' | while read line; do volume -f 'V%i' > $PANEL_FIFO;done & source ./panel_colors -cat "$PANEL_FIFO" | ./panel_bar | lemonbar -g x$PANEL_HEIGHT -f "$PANEL_FONT_FAMILY" -F "$COLOR_FOREGROUND" -B "$COLOR_BACKGROUND" & +cat "$PANEL_FIFO" | ./panel_bar | lemonbar -f "$FONT_FONT" -f "$ICON_FONT" -g x$PANEL_HEIGHT -F "$COLOR_FOREGROUND" -B "$COLOR_BACKGROUND" & sleep 1; -stalonetray --geometry 4x1-1+1 --icon-gravity E --grow-gravity E -bg $COLOR0 -i 18 & +stalonetray --geometry 1x1-415+2 --icon-gravity E --grow-gravity E -bg $COLOR0 -i 18 & 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 diff --git a/tools/panel/profile b/tools/panel/profile old mode 100644 new mode 100755 index c7a3ba0..c8b6807 --- a/tools/panel/profile +++ b/tools/panel/profile @@ -1,4 +1,7 @@ PANEL_FIFO=/tmp/panel-fifo PANEL_HEIGHT=24 -PANEL_FONT_FAMILY="-misc-fixed-medium-r-normal--13-120-75-75-c-70-iso10646-1" -export PANEL_FIFO PANEL_HEIGHT PANEL_FONT_FAMILY + +FONT_FONT="fixed" +ICON_FONT="FontAwesome-9" + +export PANEL_FIFO PANEL_HEIGHT PANEL_FONT_FAMILY FONT_FONT ICON_FONT -- cgit v1.2.3-54-g00ecf