I hate this

This commit is contained in:
Nox Sluijtman 2025-01-08 16:27:43 +01:00
parent 01ad1593f7
commit 5240cd9acd
Signed by: Egg
SSH key fingerprint: SHA256:2sG9X3C7Xvq2svGumz1/k7cm8l4G9+qAtAeugqB4J9M

View file

@ -3,6 +3,8 @@
let dateString = ^date let dateString = ^date
let discordianDate = ^ddate let discordianDate = ^ddate
def t [tag: string] {$in | get -i $tag }
def get_batteries [] { def get_batteries [] {
let power_supplies = ( let power_supplies = (
(ls /sys/class/power_supply).name (ls /sys/class/power_supply).name
@ -16,7 +18,7 @@ def get_batteries [] {
| each {|index| $power_supplies | get $index | transpose -r} | each {|index| $power_supplies | get $index | transpose -r}
$batteries $batteries
| each {|i| [ $i.POWER_SUPPLY_MANUFACTURER $i.POWER_SUPPLY_MODEL_NAME $i.POWER_SUPPLY_STATUS $i.POWER_SUPPLY_CAPACITY ] | each {|i| [ ($i | t "POWER_SUPPLY_MANUFACTURER") ($i | t "POWER_SUPPLY_MODEL_NAME") ($i | t "POWER_SUPPLY_STATUS") ($i | t "POWER_SUPPLY_CAPACITY") ]
| each { first } | each { first }
} }
| each {|str| $str | str join " " } | each {|str| $str | str join " " }