#!/usr/bin/env bash
+# Sends a notification with battery level and time
function time_set() {
date +%A", "%b" "%e", "%r
echo " battery,"
echo "$(upower -d | grep "time to empty" | tail -c 15) remaining"
else
- echo " battery"
+ echo " battery,"
+ echo "$(upower -d | grep "time to full" | tail -c 15) until charged"
fi
}
-notify-send -i "clock" "echo $(time_set)" "echo $(power_set)"
+notify-send -i "clock" "`echo $(time_set)`" "`echo $(power_set)`"