mirror of
https://forge.katzen.cafe/schrottkatze/nix-configs.git
synced 2024-12-23 09:45:52 +01:00
23 lines
463 B
Text
23 lines
463 B
Text
#!/usr/bin/env nu
|
|
|
|
const ICONS = [
|
|
[ ]
|
|
[ ]
|
|
[ ]
|
|
[ ]
|
|
[ ]
|
|
[ ]
|
|
[ ]
|
|
[ ]
|
|
[ ]
|
|
[ ]
|
|
[ ]
|
|
];
|
|
|
|
def get_bat_percent [path: string] {
|
|
let energy_full = open $"/sys/class/power_supply/($path)/energy_full" | into float;
|
|
let energy_now = open $"/sys/class/power_supply/($path)/energy_now" | into float;
|
|
|
|
($energy_now / $energy_full) * 100
|
|
}
|
|
|