#!/bin/bash # Check AC adapter status and Battery Voltage if [ $(cat /sys/class/power_supply/AC/online) = "0" ] && \ [ $(cat /sys/class/power_supply/BAT0/capacity) -le 10 ]; then # Display Notification if [ $DISPLAY ]; then notify-send -u critical \ -i /usr/share/icons/breeze/status/symbolic/battery-low-symbolic.svg \ "Battery Critically Low" "Plug in to AC or Suspend immediately"; fi # Play Alert Sound # for play_beep in {1..4}; do $(aplay /home/b00m/Downloads/beep-08b.wav > /dev/null 2>&1); done fi