Small (KDE) Python Script for Framework Laptops Battery Limiter
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-01-07 15:13:51 +01:00
battery-tray.py chore: popup slider, de+en lang 2026-01-07 15:13:51 +01:00
framwork-battery-tray.desktop chore: popup slider, de+en lang 2026-01-07 15:13:51 +01:00
README.md chore: popup slider, de+en lang 2026-01-07 15:13:51 +01:00

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+)
  • ectool
  • python3-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.

  1. Create a sudoers rule:
sudo visudo -f /etc/sudoers.d/fw-ectool
  1. Add the following line (replace YOUR_USERNAME with 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.