From 71f4a371296abdf48586fdd608480c75310b708e Mon Sep 17 00:00:00 2001 From: Vasil Zlatanov Date: Mon, 28 Oct 2019 23:16:02 +0000 Subject: Use variable temperature icons in bar --- Panel/lemonbar/panel_bar | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) (limited to 'Panel') diff --git a/Panel/lemonbar/panel_bar b/Panel/lemonbar/panel_bar index d219ec6..d039c31 100755 --- a/Panel/lemonbar/panel_bar +++ b/Panel/lemonbar/panel_bar @@ -47,15 +47,31 @@ while read -r line ; do ;; + T*) + level=${line#?} + if [ "$level" -gt 90 ];then + ICON_TEMP=$ICON_T4 + elif [ "$level" -gt 65 ];then + ICON_TEMP=$ICON_T3 + elif [ "$level" -gt 35 ];then + ICON_TEMP=$ICON_T2 + elif [ "$level" -gt 15 ];then + ICON_TEMP=$ICON_T1 + else + ICON_TEMP=$ICON_T0 + fi + temperature="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG} ${ICON_TEMP} ${level} %{B-}%{F-}"; + ;; + BDischarging*) - level=`echo ${line#?} | cut -d' ' -f2` - if [ $level -gt 90 ];then + level=$(echo ${line#?} | cut -d' ' -f2) + if [ "$level" -gt 90 ];then ICON_PWR=$ICON_BAT100 - elif [ $level -gt 65 ];then + elif [ "$level" -gt 65 ];then ICON_PWR=$ICON_BAT75 - elif [ $level -gt 35 ];then + elif [ "$level" -gt 35 ];then ICON_PWR=$ICON_BAT50 - elif [ $level -gt 15 ];then + elif [ "$level" -gt 15 ];then ICON_PWR=$ICON_BAT25 else ICON_PWR=$ICON_BAT0 @@ -124,6 +140,6 @@ while read -r line ; do # wm_infos="$wm_infos %{F$COLOR_LAYOUT_FG}%{B$COLOR_LAYOUT_BG} ${name} %{B-}%{F-}" # ;; 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}${essid}${signal}${volume}${musicvol}${temperature}${battery}${time_infos} " # printf "%s\n" "%{l}${desktop}${wm_infos}%{r}${notification}${face}${priv}${pub}${mail}${playing}${paused}${cpu}${ram}${volume}${battery}${time_infos}" done -- cgit v1.2.3-54-g00ecf