start eww bar setup
This commit is contained in:
parent
3c11d4177b
commit
a29f210273
6 changed files with 124 additions and 0 deletions
23
modules/desktop-environment/home/panels/eww/scripts/bat.nu
Normal file
23
modules/desktop-environment/home/panels/eww/scripts/bat.nu
Normal file
|
@ -0,0 +1,23 @@
|
|||
#!/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
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue