mybin

my ~/bin
git clone https://a3nm.net/git/mybin/
Log | Files | Refs | README

battery_notify (272B)


      1 #!/bin/bash
      2 
      3 # source: https://bbs.archlinux.org/viewtopic.php?pid=1080737#p1080737
      4 
      5 BATTINFO=`acpi -b`
      6 if [[ `echo $BATTINFO | grep Discharging` && `echo $BATTINFO | cut -f 5 -d " "` < 01:00:00 ]] ; then
      7     DISPLAY=:0.0 /usr/bin/notify-send "low battery" "$BATTINFO"
      8 fi