#!/usr/bin/env bash
-
-function time_set() {
- date +%A", "%b" "%e" | "%r
+# Sends a notification with the time, battery level, and volume
+
+time_set() {
+ date "+%A %Y-%m-%d, %r"
+}
+
+power_set() {
+ echo -n "$(upower -d | grep percentage | tail -c 5)"
+ if [[ $(upower -d | grep "discharging") ]]; then
+ echo -n " battery,"
+ echo "$(upower -d | grep "time to empty" | tail -c 15) remaining"
+ else
+ echo -n " battery,"
+ echo "$(upower -d | grep "time to full" | tail -c 15) until charged"
+ fi
}
-function power_set() {
- upower -d | grep percentage | tail -c 5
- echo " battery,"
- upower --dump | grep "time to empty" | tail -c 15
+volume_set() {
+ echo "$(amixer sget Master | tail -n 1 | tail -c +21)"
}
-notify-send -i "clock" "`echo $(time_set)`" "`echo $(power_set) remaining`"
+notify-send "$(time_set)" "$(power_set)\n$(volume_set)"