Automatic Low Power Mode Manager - A lightweight macOS menu bar application that automatically enables Low Power Mode when your battery reaches a customizable threshold.
- 🔋 Dual Operating Modes:
- Automatic Mode - Automatically enables Low Power Mode at your threshold (requires one-time setup)
- Prompt Mode - Asks you to enable Low Power Mode manually (works immediately, Mac App Store compatible)
- 🎚️ Threshold Slider - Easily adjust activation threshold from 5% to 95% via dropdown menu
- 💤 Visual Indicators - Clear menu bar icons show battery and Low Power Mode status
- ⚡ Manual Controls - Enable or disable Low Power Mode with one click
- 🔔 Smart Notifications - Get notified when Low Power Mode is activated
- 💾 Persistent Settings - Your preferences are saved and restored automatically
- 🚀 Auto-Launch - Optional automatic startup on login via LaunchAgent
- 🔓 Passwordless Operation - Optional setup for password-free Low Power Mode switching
Menu Bar Interface:
┌──────────────────────────────────┐
│ Threshold: 20% ▶ │ ← Slider submenu (5-95%)
├──────────────────────────────────┤
│ ✓ Enabled │ ← Enable Low Power Mode
│ Disabled │ ← Disable Low Power Mode
├──────────────────────────────────┤
│ Mode: Automatic │ ← Toggle between Auto/Prompt
├──────────────────────────────────┤
│ Current Battery │
│ Current Power Mode │
├──────────────────────────────────┤
│ About │
├──────────────────────────────────┤
│ Quit │
└──────────────────────────────────┘
Menu Bar Icons:
- 💤 Low Power Mode is ON
- 🔌 Charging (AC Power)
- 🔋 On Battery (normal)
- 🪫 Low Battery (≤ 20%)
- ⚡ At Threshold
-
Clone the repository:
git clone https://github.com/daniel/battery-saver.git cd battery-saver -
Install dependencies:
pip3 install -r requirements.txt
-
Run the app:
./start_battery_saver.sh
The app will appear in your menu bar!
./install_launch_agent.shBattery Saver will now start automatically every time you log in.
Battery Saver has two modes:
1. Prompt Mode (Default)
- Works immediately, no setup required
- Opens System Settings when battery hits threshold
- You manually enable Low Power Mode
- Mac App Store compatible
2. Automatic Mode (Recommended)
- Enables Low Power Mode automatically
- Requires one-time passwordless setup:
./setup_passwordless_pmset.sh
- Creates a secure sudoers rule for
pmset lowpowermodeonly
Switch modes: Click "Mode: ..." in the menu to toggle between Auto and Prompt modes.
- macOS 10.14 (Mojave) or later
- Python 3.7 or later
rumpslibrary (installed via requirements.txt)
- Click the Battery Saver icon in your menu bar
- Hover over "Threshold: XX%"
- Select your desired percentage (5-95%)
- Done! Low Power Mode will now activate at that battery level
- Click "Enabled" to immediately enable Low Power Mode
- Click "Disabled" to immediately disable Low Power Mode
- Checkmark shows which mode is currently active
- Current Battery - View battery level and power source
- Current Power Mode - Check if Low Power Mode is active
Run Battery Saver completely invisibly with no menu bar icon:
./install_daemon.shControl via command line:
python3 battery_control.py status
python3 battery_control.py threshold 25
python3 battery_control.py enable
python3 battery_control.py disableSee BACKGROUND_MODE.md for full documentation.
For a version designed to sit next to the system battery icon:
python3 battery_saver_minimal.pySee ICON_STYLES.md for details on different icon styles.
- QUICK_START.md - Get started in 2 minutes
- PASSWORDLESS_SETUP.md - Setup password-free operation
- BACKGROUND_MODE.md - Run without menu bar icon
- ICON_STYLES.md - Different icon style options
- POSITIONING_GUIDE.md - Position icon next to system battery
- CHANGELOG.md - Version history
Battery Saver:
- ✅ Stores settings locally in
~/.battery_saver_config.json - ✅ Does not collect or transmit any data
- ✅ Does not access the internet
- ✅ Is fully open source
- ✅ Passwordless setup only affects
pmset lowpowermodecommand
- Monitors your battery level every 30 seconds
- Detects when you're on battery power (not plugged in)
- Activates Low Power Mode when battery ≤ your threshold
- Uses macOS
pmsetcommand to control Low Power Mode - Logs everything for troubleshooting
Battery_saver/
├── battery_saver.py # Main menu bar application
├── battery_saver_daemon.py # Background daemon (no UI)
├── battery_saver_minimal.py # Minimal version
├── battery_control.py # CLI control tool
├── start_battery_saver.sh # Quick launch script
├── install_launch_agent.sh # Auto-start installer
├── install_daemon.sh # Background daemon installer
├── setup_passwordless_pmset.sh # Passwordless setup
├── requirements.txt # Python dependencies
├── README.md # This file
└── LICENSE # MIT License
Run the test suite:
python3 test_battery_functions.pyExpected output:
✅ Battery level detection working
✅ Power mode detection working
✅ Config file exists
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
MIT License
Copyright (c) 2025 Daniel
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
- Built with rumps - Ridiculously Uncomplicated macOS Python Statusbar apps
- Uses macOS
pmsetfor power management
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Added:
- Dual mode support: Automatic Mode and Prompt Mode
- Automatic mode detection (checks if passwordless sudo is configured)
- User-switchable modes via menu
- Prompt Mode opens System Settings with helpful notifications
- Updated About dialog with mode information
- Mac App Store compatibility via Prompt Mode
Changed:
- Default mode is now Prompt Mode (no setup required)
- Enhanced user experience with mode indicators
- Version bumped to 1.1.0
Added:
- Initial release
- Automatic Low Power Mode activation at customizable battery threshold
- Menu bar application with visual battery indicator
- Threshold slider submenu (5-95%)
- Manual Low Power Mode enable/disable controls
- Smart notifications
- Persistent configuration
- LaunchAgent support for auto-launch
- Background daemon mode (no UI)
- CLI control tool
- Passwordless sudo setup
- Comprehensive documentation
Version: 1.1.0 Status: Stable Last Updated: October 24, 2025 Compatibility: macOS 10.14+ (Mojave and later)
Made with ❤️ for macOS users who want smarter battery management
Copyright (c) 2025 Daniel Bates / BatesAI
This project is licensed under the MIT License - see the LICENSE file for details.
While this code is open source under the MIT License, the BatesAI brand name and associated trademarks are proprietary. Please do not use the BatesAI name or logo without permission.
For commercial support or custom development, contact: daniel@batesai.org