From a656c375e9ce53b2074ae5798abd436f5daf8d9b Mon Sep 17 00:00:00 2001 From: Shubham Saini Date: Wed, 24 Jun 2020 16:08:07 +0530 Subject: added + & - for bat --- spectrwm/.config/spectrwm/statusbar | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'spectrwm/.config') diff --git a/spectrwm/.config/spectrwm/statusbar b/spectrwm/.config/spectrwm/statusbar index 5f6918c..01e1223 100755 --- a/spectrwm/.config/spectrwm/statusbar +++ b/spectrwm/.config/spectrwm/statusbar @@ -7,7 +7,12 @@ vol(){ bat() { power=$(cat /sys/class/power_supply/BAT0/capacity) - echo -e "+@fg=1;bat+@fg=0; $power% " + status=$(cat /sys/class/power_supply/BAT0/status) + if [ "$status" == "Charging" ]; then + echo -e "+@fg=1;bat+@fg=0; +$power% " + elif [ "$status" == "Discharging" ]; then + echo -e "+@fg=1;bat+@fg=0; -$power% " + fi } dte() { -- cgit v1.2.3