From f26864c1443d07c2aff9a939b458e85ea3070d82 Mon Sep 17 00:00:00 2001 From: Armaan Bhojwani <3fb650a9-b47e-4604-a282-1dd91953b2ee@anonaddy.me> Date: Thu, 1 Oct 2020 20:33:35 -0400 Subject: [PATCH] made more extensible --- status | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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`" -- 2.39.2