Last active
August 29, 2015 14:27
-
-
Save jaywon/ae1970b207eaa24c8414 to your computer and use it in GitHub Desktop.
Monitor and notification script to show low battery when not using Unity or other desktop manager in Ubuntu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| while true | |
| do | |
| BATTERY_LEVEL=$(</sys/class/power_supply/BAT0/capacity) | |
| if [ "$BATTERY_LEVEL" -lt "15" ]; then | |
| notify-send -t 100 "Battery level is $BATTERY_LEVEL" | |
| fi | |
| sleep 100 | |
| done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @reboot /path/to/batterymonitor.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment