aboutsummaryrefslogtreecommitdiff
path: root/Panel
diff options
context:
space:
mode:
authorVasil Zlatanov <v@skozl.com>2019-06-24 17:09:17 +0100
committerVasil Zlatanov <v@skozl.com>2019-06-24 17:09:17 +0100
commitdd47092aa2212c0118de4014de502a0d8e673334 (patch)
tree704b0852f799861c2e12db9b95e07fdd7f446014 /Panel
parent4f474e3cf7187a0605343167f32bfcb2b8fe4e4d (diff)
downloaddotfiles-dd47092aa2212c0118de4014de502a0d8e673334.tar.gz
dotfiles-dd47092aa2212c0118de4014de502a0d8e673334.tar.bz2
dotfiles-dd47092aa2212c0118de4014de502a0d8e673334.zip
Change lemonbar battery icon based on how much battery is left
Diffstat (limited to 'Panel')
-rwxr-xr-xPanel/lemonbar/icons8
-rwxr-xr-xPanel/lemonbar/panel2
-rwxr-xr-xPanel/lemonbar/panel_bar26
-rwxr-xr-xPanel/lemonbar/profile4
4 files changed, 28 insertions, 12 deletions
diff --git a/Panel/lemonbar/icons b/Panel/lemonbar/icons
index aa27523..8c8f7af 100755
--- a/Panel/lemonbar/icons
+++ b/Panel/lemonbar/icons
@@ -1,9 +1,13 @@
-# Icons
+# Icons ICON_CLOCK=''
ICON_CLOCK=''
ICON_CAL=''
ICON_WIFI=''
-ICON_PWR=''
+ICON_BAT100=''
+ICON_BAT75=''
+ICON_BAT50=''
+ICON_BAT25=''
+ICON_BAT0=''
ICON_DB=''
ICON_SQUARE=''
ICON_PREV=''
diff --git a/Panel/lemonbar/panel b/Panel/lemonbar/panel
index f7d0cd7..8058e56 100755
--- a/Panel/lemonbar/panel
+++ b/Panel/lemonbar/panel
@@ -12,7 +12,7 @@ mkfifo -m 777 "$PANEL_FIFO"
./windows > "$PANEL_FIFO" &
#echo "D`rpws current`" > "$PANEL_FIFO" &
volume -f 'V%i' > "$PANEL_FIFO" &
-battery -i 60 -sf 'B%s %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" &
diff --git a/Panel/lemonbar/panel_bar b/Panel/lemonbar/panel_bar
index 64eed1d..d219ec6 100755
--- a/Panel/lemonbar/panel_bar
+++ b/Panel/lemonbar/panel_bar
@@ -43,17 +43,29 @@ while read -r line ; do
;;
K*)
# volume output
- #musicvol="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG} ${ICON_MUSIC} ${line#?} %{B-}%{F-}"
+ musicvol="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG} ${ICON_MUSIC} ${line#?} %{B-}%{F-}"
;;
BDischarging*)
- percent=`echo ${line#?} | cut -d' ' -f2`
- battery="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG} ${ICON_PWR} ${percent} %{B-}%{F-}";
+ level=`echo ${line#?} | cut -d' ' -f2`
+ if [ $level -gt 90 ];then
+ ICON_PWR=$ICON_BAT100
+ elif [ $level -gt 65 ];then
+ ICON_PWR=$ICON_BAT75
+ elif [ $level -gt 35 ];then
+ ICON_PWR=$ICON_BAT50
+ elif [ $level -gt 15 ];then
+ ICON_PWR=$ICON_BAT25
+ else
+ ICON_PWR=$ICON_BAT0
+ fi
+ battery="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG} ${ICON_PWR} ${level} %{B-}%{F-}";
;;
B*)
- percent=`echo ${line#?} | cut -d' ' -f2`
- battery="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG} ${ICON_PLUG} ${percent} %{B-}%{F-}";
+ level=`echo ${line#?} | cut -d' ' -f2`
+ battery="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG} ${ICON_PLUG} ${level} %{B-}%{F-}";
+
;;
@@ -112,6 +124,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}${desktop}${wm_infos}%{r}${notification}${face}${priv}${pub}${mail}${playing}${paused}${cpu}${ram}${volume}${battery}${time_infos}"
+ printf "%s\n" "%{l}${wm_infos}${title}%{r}${playing}${paused}${cpu}${ram}${essid}${signal}${volume}${musicvol}${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
diff --git a/Panel/lemonbar/profile b/Panel/lemonbar/profile
index fe9d7b1..67b2b96 100755
--- a/Panel/lemonbar/profile
+++ b/Panel/lemonbar/profile
@@ -2,7 +2,7 @@
PANEL_FIFO=/tmp/panel-fifo
PANEL_HEIGHT=40
-FONT_FONT="DejaVuSans-10"
-ICON_FONT="FontAwesome-10"
+FONT_FONT="OperatorMonoLigBook-12"
+#ICON_FONT="FontAwesome-10"
export PANEL_FIFO PANEL_HEIGHT PANEL_FONT_FAMILY FONT_FONT ICON_FONT