From 5240cd9acd462317554fac709c2d4f36a47d59a0 Mon Sep 17 00:00:00 2001 From: Marty Sluijtman Date: Wed, 8 Jan 2025 16:27:43 +0100 Subject: [PATCH] I hate this --- src/bin/status-notification | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 " " }