I hate this
This commit is contained in:
parent
01ad1593f7
commit
5240cd9acd
|
@ -3,6 +3,8 @@
|
|||
let dateString = ^date
|
||||
let discordianDate = ^ddate
|
||||
|
||||
def t [tag: string] {$in | get -i $tag }
|
||||
|
||||
def get_batteries [] {
|
||||
let power_supplies = (
|
||||
(ls /sys/class/power_supply).name
|
||||
|
@ -16,7 +18,7 @@ def get_batteries [] {
|
|||
| each {|index| $power_supplies | get $index | transpose -r}
|
||||
|
||||
$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 {|str| $str | str join " " }
|
||||
|
|
Loading…
Reference in a new issue