diff options
| author | Sam Nystrom <sam@samnystrom.dev> | 2023-09-07 21:13:11 -0400 |
|---|---|---|
| committer | Sam Nystrom <sam@samnystrom.dev> | 2023-09-07 21:13:11 -0400 |
| commit | 3033f89b13e03597855bd1a13365fd73bf1b1a34 (patch) | |
| tree | 3b3b44e06e971639975cb468ae9528d290383a9b /bin | |
| parent | e023da000caf7693682cd9113e2085ec1256bf0b (diff) | |
statusbar: read battery status from the right file
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/statusbar | 5 |
1 files 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; } - |
