Wouldn’t it be great if your computer could remind you when your battery is low or fully charged?
Well, the good news is, we can easily build a Desktop Battery Notifier in Python with the given steps.
Let’s walk through how it works.

How Does This Battery Notifier Work?
This small Python script checks your laptop’s battery level and shows a pop-up notification based on certain conditions. It tells you:
- When your battery is low.
- When it’s fully charged.
- When it’s charging but not yet full.
- When it’s time to unplug the charger for better battery life.
What Do We Need to build this Desktop Battery Notifier?
To build this project, we use two Python libraries:
<em><strong>plyer</strong></em>
: It shows desktop notifications.<strong><em>psutil</em></strong>
: It helps get battery information like percentage and charging status.
You can install both using pip if they are not already available.
Main Logic Behind the Notifier
The logic is quite easy to understand. The script runs and checks two things:
- Battery percentage
- Whether the charger is plugged in or not
Then, depending on these two factors, it shows different messages.
For example:
- If the charger is plugged in and the battery is 100%, it notifies you to unplug.
- If the charger is plugged in and battery is below 80%, it reminds you to charge more.
- If the charger is not plugged in and the battery is below 20%, it alerts you to plug in.
- If battery is somewhere around 50%, it gives a general battery update.
When Will You See Notifications?
You’ll get notifications in these situations:
- Charging and battery is full
- Charging and battery is below 80%
- Not charging and battery is low
- Not charging and battery is okay
- Not charging and battery is full
Each of these cases shows a clear pop-up message on your desktop screen.
Why Is This Useful?
There are many reasons why this battery notifier script is useful:
- Avoid overcharging your laptop battery.
- Helps maintain better battery life.
- You don’t need to keep checking the battery status manually.
- Perfect for students, professionals, and coders who often forget to monitor battery.
# Importing required libraries from plyer import notification import psutil # Get battery status battery_status = psutil.sensors_battery() is_charging = battery_status.power_plugged # Main logic if __name__ == "__main__": charge_percent = battery_status.percent if is_charging: if charge_percent <= 80: notification.notify( title = "Charging Advice", message = "To keep battery healthy, unplug after 80%.", timeout = 2 ) elif charge_percent == 100: notification.notify( title = "Battery Full", message = "Unplug now. Battery is at 100%.", timeout = 2 ) else: notification.notify( title = "Charging Status", message = "Battery charging above 80%. Consider unplugging.", timeout = 2 ) else: if charge_percent <= 20: notification.notify( title = "Low Battery Alert", message = "Battery low! Plug in your device.", timeout = 2 ) elif charge_percent <= 50: notification.notify( title = "Battery Check", message = f"Battery is at {charge_percent}%.", timeout = 2 ) elif charge_percent == 100: notification.notify( title = "Battery Full", message = "Battery is fully charged.", timeout = 2 ) else: notification.notify( title = "Battery Update", message = f"Battery level: {charge_percent}%", timeout = 2 )

Final Words
Creating a desktop battery notifier in Python is a super fun and helpful project — especially for beginners. It doesn’t need any GUI or heavy setup. Just install the libraries, write a few lines of code, and you’re good to go.
It’s small, but it solves a real problem.