Quantcast
Viewing latest article 4
Browse Latest Browse All 5

Answer by Devarshi Sathiya for How can I get notification when my laptop battery gets fully charged?

Here is the Crontab that I use

  1. Notify if battery is full (equal to 100%)

    */1 * * * * if [ $(cat /sys/class/power_supply/BAT0/capacity) -eq 100 ]; then XDG_RUNTIME_DIR=/run/user/$(id -u) notify-send Hey "Battery Full"; fi
  2. Notify if battery is low (less than or equal to 10%)

    */1 * * * * if [ $(cat /sys/class/power_supply/BAT0/capacity) -le 10 ]; then XDG_RUNTIME_DIR=/run/user/$(id -u) notify-send Hey "Battery Low"; fi

Example Notification Image:

Image may be NSFW.
Clik here to view.
Example Notification Image


Viewing latest article 4
Browse Latest Browse All 5

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>