Small (KDE) Python Script for Framework Laptops Battery Limiter
- Python 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| battery-tray.py | ||
| framwork-battery-tray.desktop | ||
| README.md | ||
Framework Battery Tray (Fedora/KDE)
A simple PyQt6 system tray indicator to toggle battery charge limits (80% / 100% / Custom) on Framework Laptops.
Works natively on Wayland (Fedora KDE) and uses ectool backend.
Requirements
- Fedora (tested on KDE Plasma)
- Framework Laptop (12th Gen+)
ectoolpython3-pyqt6
Installation
1. Install ectool & Python deps
Enable the community Copr for the EC tool and install PyQt6:
sudo dnf copr enable rowanfr/fw-ectool
sudo dnf install fw-ectool python3-pyqt6
2. Configure Sudoers
The script needs to run ectool without a password prompt.
- Create a sudoers rule:
sudo visudo -f /etc/sudoers.d/fw-ectool
- Add the following line (replace
YOUR_USERNAMEwith your actual username):
YOUR_USERNAME ALL=(ALL) NOPASSWD: /usr/bin/ectool fwchargelimit *
Usage
Copy files to the right locations:
# Copy the script
cp battery-tray.py ~/.local/bin/
chmod +x ~/.local/bin/battery-tray.py
# Copy the desktop file
cp framework-battery-tray.desktop ~/.local/share/applications/
Run it:
~/.local/bin/battery-tray.py &
Autostart: Open KDE System Settings > Autostart and add the script path ~/.local/bin/battery-tray.py.