From 783b040ff6f0b7b2e9e2ce8e280faa89aa290f46 Mon Sep 17 00:00:00 2001 From: Armaan Bhojwani Date: Sun, 24 Jan 2021 12:15:09 -0500 Subject: [PATCH] Status: ISO 8601, code cleanup, add volume display --- status | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/status b/status index 9154162..e5e5138 100755 --- a/status +++ b/status @@ -1,19 +1,23 @@ #!/usr/bin/env bash -# Sends a notification with battery level and time +# Sends a notification with the time, battery level, and volume -function time_set() { - date +%A", "%b" "%e", "%r +time_set() { + date "+%A %Y-%m-%d, %r" } -function power_set() { - upower -d | grep percentage | tail -c 5 +power_set() { + echo -n "$(upower -d | grep percentage | tail -c 5)" if [[ $(upower -d | grep "discharging") ]]; then - echo " battery," + echo -n " battery," echo "$(upower -d | grep "time to empty" | tail -c 15) remaining" else - echo " battery," + echo -n " battery," echo "$(upower -d | grep "time to full" | tail -c 15) until charged" fi } -notify-send -i "clock" "`echo $(time_set)`" "`echo $(power_set)`" +volume_set() { + echo "$(amixer sget Master | tail -n 1 | tail -c +21)" +} + +notify-send "$(time_set)" "$(power_set)\n$(volume_set)" -- 2.39.2