fix bat.nu

This commit is contained in:
Schrottkatze 2026-09-27 19:22:56 +02:00
commit cf487e6ed0

View file

@ -21,7 +21,7 @@ def "main auto" [] {
loop {
let paths = ls "/sys/class/power_supply"
| each {|it| $it.name | path basename}
| filter {|it| $it starts-with "BAT"};
| where $it starts-with "BAT";
if ($paths | is-not-empty) {
let result = $paths
@ -74,5 +74,5 @@ def get_bat_icon [
frac: float
is_charging = false
] {
$ICONS | get (($frac * 10) | math round) | get (if ($is_charging) { "charging" } else { "normal" })
$ICONS | get (($frac * 10) | math round | into cell-path) | get (if ($is_charging) { "charging" } else { "normal" })
}