]> 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 9154162fd7b27ef8e2a218ec4c5e60fd92715023..9ebab1c27a3b8a0a996526649bcdf68067462fa1 100755 (executable)
--- a/status
+++ b/status
@@ -1,19 +1,16 @@
 #!/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
-  if [[ $(upower -d | grep "discharging") ]]; then
-    echo " battery,"
-    echo "$(upower -d | grep "time to empty" | tail -c 15) remaining"
-  else
-    echo " battery,"
-    echo "$(upower -d | grep "time to full" | tail -c 15) until charged"
-  fi
+power_set() {
+  echo $(acpi | tail -c +12)
 }
 
-notify-send -i "clock" "`echo $(time_set)`" "`echo $(power_set)`"
+volume_set() {
+  echo "$(amixer sget Master | tail -n 1 | cut -d " " -f 7-)"
+}
+
+notify-send "$(time_set)" "$(power_set)\n$(volume_set)"