### Method-1: Shell script to send an alert when the battery level is above 95% or below 20%
This script runs in the background on startup and checks the battery status every minute and then sends a notification when the battery level is charged above 95% or discharged less than 20%.
The alert will not go off until your battery is over 20% or less than 95% charged.
Once the script is ready, set the executable permission.
```
$ sudo chmod +x /opt/scripts/battery-status.sh
```
Finally, add the script to the bottom of the user profile file. For system-wide, you need to add the script on the /etc/profile file.
```
$ vi /home/magi/.profile
/opt/scripts/battery-status.sh &
```
**[Reboot your Linux system][2]** to check this.
```
$ sudo reboot
```
### Method-2: Shell script to send a notification when the battery level is charged (above 95%) or discharged (below 20%)
This script is similar to the above script, but it is responsible with the AC adapter.
If your AC adapter is plugged in and the battery is charged above 95%, it will send a notification with a sound, but the notification will not stop until you unplug the AC adapter.
![][3]
If you unplug the AC adapter, you will never see the notification again until your battery charge drops to 20%.