diff --git a/src/bin/status-notification b/src/bin/status-notification index c357a6d..c127c29 100755 --- a/src/bin/status-notification +++ b/src/bin/status-notification @@ -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 " " }