From 3033f89b13e03597855bd1a13365fd73bf1b1a34 Mon Sep 17 00:00:00 2001 From: Sam Nystrom Date: Thu, 7 Sep 2023 21:13:11 -0400 Subject: statusbar: read battery status from the right file --- bin/statusbar | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bin/statusbar b/bin/statusbar index 66f0b49..bc74cae 100755 --- a/bin/statusbar +++ b/bin/statusbar @@ -32,12 +32,12 @@ sub network { sub brightness { my @brightness = split(/,/, `brightnessctl -m`); - return span('#eed49f', $brightness[3]); + return span('#eed49f', ' ' . $brightness[3]); } sub battery { open my $cap_file, '<', '/sys/class/power_supply/BAT0/capacity' or die; - open my $status_file, '<', '/sys/class/power_supply/BAT0/capacity' or die; + open my $status_file, '<', '/sys/class/power_supply/BAT0/status' or die; chomp(my $capacity = <$cap_file>); chomp(my $status = <$status_file>); close $status_file; @@ -68,4 +68,3 @@ while (1) { system('somebar', '-c', 'status', $status); sleep 1; } - -- cgit v1.2.3