A smart battery indicator extension for GNOME Shell that provides intelligent notifications for battery levels to help optimize battery health and user productivity.
- 🔋 Smart Battery Monitoring: Continuously monitors battery level every 30 seconds
- 🔔 Intelligent Notifications:
- Low battery alert when level drops below 40% (and not charging)
- High battery alert when level reaches 80% or above (while charging)
- 🎛️ Toggle Control: Click the panel icon to enable/disable notifications
- ⏰ Notification Cooldown: 30-second cooldown prevents notification spam
- 🎨 Visual Indicators: Custom icons show notification status (on/off)
- 📍 Panel Integration: Clean integration with GNOME Shell top panel
The extension must be installed to:
~/.local/share/gnome-shell/extensions/batteryind@ash.ext.com/
This is the standard location where GNOME Shell looks for user extensions.
-
Clone or download this repository:
git clone https://github.com/ash-baseplate/BatteryInd.git
-
Copy the extension to your local extensions directory:
cp -r BatteryInd ~/.local/share/gnome-shell/extensions/batteryind@ash.ext.com/Note: The folder name
batteryind@ash.ext.commust match the UUID inmetadata.json -
Restart GNOME Shell:
- Press
Alt + F2 - Type
rand press Enter - Or log out and log back in
- Press
-
Enable the extension:
gnome-extensions enable batteryind@ash.ext.com
-
Install GNOME Extensions Manager if you haven't already:
sudo apt install gnome-shell-extension-manager
-
Copy the extension to the extensions directory (step 2 from Method 1)
-
Open Extensions Manager and enable "Battery Indicator"
- Enable/Disable Notifications: Click the battery indicator icon in the top panel
- Visual Status:
- Green icon: Notifications enabled
- Gray icon: Notifications disabled
- Low Battery (< 40%): Get notified when battery is low and not charging
- High Battery (≥ 80%): Get notified when battery is high and still charging
- Smart Cooldown: Notifications have a 30-second cooldown to prevent spam
This extension is compatible with GNOME Shell versions:
- 43.x
- 44.x
- 45.x
- 46.x
- 47.x
- 48.x
batteryind@ash.ext.com/
├── extension.js # Main extension logic
├── metadata.json # Extension metadata and compatibility
├── icons/ # Custom icons
│ ├── on.png # Notifications enabled icon
│ └── off.png # Notifications disabled icon
└── README.md # This file
This extension promotes good battery health practices:
- 40% Low Threshold: Prevents deep discharge cycles that can damage lithium-ion batteries
- 80% High Threshold: Avoids keeping batteries at 100% charge, which can reduce long-term capacity
- Lightweight: Minimal system resource usage
- Efficient Polling: 30-second check intervals balance responsiveness with battery life
- Non-blocking: Uses GLib timeouts for asynchronous operation
-
Check if the extension is enabled:
gnome-extensions list --enabled | grep batteryind -
Check for errors in the logs:
journalctl -f -o cat /usr/bin/gnome-shell
-
Restart GNOME Shell:
# On X11 killall -3 gnome-shell # On Wayland (requires logout/login) gnome-session-quit --logout
-
Ensure notifications are enabled in GNOME Settings:
- Open Settings → Notifications
- Make sure notifications are enabled
-
Check if the extension icon shows notifications are enabled (green icon)
-
Test with battery levels in the trigger ranges (< 40% or ≥ 80%)
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes
- Test the extension thoroughly
- Commit your changes:
git commit -am 'Add some feature' - Push to the branch:
git push origin feature-name - Submit a pull request
This project is open source. Feel free to use, modify, and distribute as needed.
Ash Baseplate
- GitHub: @ash-baseplate
- Repository: BatteryInd
- Initial release
- Basic battery monitoring and notifications
- Toggle functionality for enabling/disabling notifications
- Support for GNOME Shell 43-48
⭐ If you find this extension useful, please consider giving it a star on GitHub!