]> git.armaanb.net Git - bin.git/blob - status
Caddy-reload: create
[bin.git] / status
1 #!/usr/bin/env bash
2 # Sends a notification with battery level and time
3
4 function time_set() {
5   date +%A", "%b" "%e", "%r
6 }
7
8 function power_set() {
9   upower -d | grep percentage | tail -c 5
10   if [[ $(upower -d | grep "discharging") ]]; then
11     echo " battery,"
12     echo "$(upower -d | grep "time to empty" | tail -c 15) remaining"
13   else
14     echo " battery,"
15     echo "$(upower -d | grep "time to full" | tail -c 15) until charged"
16   fi
17 }
18
19 notify-send -i "clock" "`echo $(time_set)`" "`echo $(power_set)`"