]> git.armaanb.net Git - bin.git/blobdiff - status
Audio-set: switch to cut for parsing volume
[bin.git] / status
diff --git a/status b/status
index 7f3843a45c47d6eb8a635cde27720124b50a0685..9ebab1c27a3b8a0a996526649bcdf68067462fa1 100755 (executable)
--- a/status
+++ b/status
@@ -1,18 +1,16 @@
-#!/usr/bin/env sh
-function time_set() {
-  date +%A" "%B" "%e" | "%1l:%M:%S
-}
+#!/usr/bin/env bash
+# Sends a notification with the time, battery level, and volume
 
-function power_set() {
-  upower -d | grep percentage | tail -c 4 | head -c 3
-  echo " battery,"
-  upower --dump | grep "time to empty" | tail -c 15
+time_set() {
+  date "+%A %Y-%m-%d, %r"
 }
 
-export TIME=$(time_set)
-export POWER=$(power_set)
-
-notify-send -i "clock" "`echo $TIME`" "`echo $POWER`"
+power_set() {
+  echo $(acpi | tail -c +12)
+}
 
+volume_set() {
+  echo "$(amixer sget Master | tail -n 1 | cut -d " " -f 7-)"
+}
 
+notify-send "$(time_set)" "$(power_set)\n$(volume_set)"