From c94d46b9ef8f552db0db1afaf11b71a53c3dd006 Mon Sep 17 00:00:00 2001 From: Severin Kaderli Date: Wed, 29 May 2019 14:02:41 +0200 Subject: [PATCH] Fix polybar battery module Signed-off-by: Severin Kaderli --- system/.config/polybar/config | 2 +- system/.config/polybar/launch | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/system/.config/polybar/config b/system/.config/polybar/config index 9033de2..d4330b7 100644 --- a/system/.config/polybar/config +++ b/system/.config/polybar/config @@ -191,7 +191,7 @@ interval = 60 [module/battery] type = internal/battery full-at = 99 -battery = BAT0 +battery = ${env:POLYBAR_BATTERY} adapter = AC time-format = %H:%M diff --git a/system/.config/polybar/launch b/system/.config/polybar/launch index 1851fc9..e5afca7 100755 --- a/system/.config/polybar/launch +++ b/system/.config/polybar/launch @@ -18,6 +18,11 @@ killall -q polybar # Wait until the processes have been shut down while pgrep -x polybar >/dev/null; do sleep 1; done +if [ "${IS_WORK}" = "1" ]; then + POLYBAR_BATTERY="BAT1" +else + POLYBAR_BATTERY="BAT0" +fi # Launch bar1 and bar2 polybar top &