From: Armaan Bhojwani <3fb650a9-b47e-4604-a282-1dd91953b2ee@anonaddy.me> Date: Fri, 2 Oct 2020 00:33:35 +0000 (-0400) Subject: made more extensible X-Git-Tag: v0.0.1~103 X-Git-Url: https://git.armaanb.net/?p=bin.git;a=commitdiff_plain;h=f26864c1443d07c2aff9a939b458e85ea3070d82 made more extensible --- diff --git a/status b/status index ee0a0c5..7f3843a 100755 --- a/status +++ b/status @@ -1,4 +1,18 @@ #!/usr/bin/env sh -notify-send -i "clock" "`date +%A" "%B" "%e" | "%1l:%M:%S `" "`upower -d | grep percentage | tail -c 4 | head -c 3 && echo " battery" && upower --dump | grep "time to empty" | tail -c 11 | head -c 11`" + +function time_set() { + date +%A" "%B" "%e" | "%1l:%M:%S +} + +function power_set() { + upower -d | grep percentage | tail -c 4 | head -c 3 + echo " battery," + upower --dump | grep "time to empty" | tail -c 15 +} + +export TIME=$(time_set) +export POWER=$(power_set) + +notify-send -i "clock" "`echo $TIME`" "`echo $POWER`"