mirror of
https://forge.katzen.cafe/schrottkatze/nix-configs.git
synced 2026-09-30 06:39:07 +02:00
fix bat.nu
This commit is contained in:
parent
7b6b1fedd1
commit
cf487e6ed0
1 changed files with 2 additions and 2 deletions
|
|
@ -21,7 +21,7 @@ def "main auto" [] {
|
||||||
loop {
|
loop {
|
||||||
let paths = ls "/sys/class/power_supply"
|
let paths = ls "/sys/class/power_supply"
|
||||||
| each {|it| $it.name | path basename}
|
| each {|it| $it.name | path basename}
|
||||||
| filter {|it| $it starts-with "BAT"};
|
| where $it starts-with "BAT";
|
||||||
|
|
||||||
if ($paths | is-not-empty) {
|
if ($paths | is-not-empty) {
|
||||||
let result = $paths
|
let result = $paths
|
||||||
|
|
@ -74,5 +74,5 @@ def get_bat_icon [
|
||||||
frac: float
|
frac: float
|
||||||
is_charging = false
|
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" })
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue