Skip to content

VVAT3R/legion-linux-toolkit

Repository files navigation

Legion Linux Toolkit

Legion Linux Toolkit

A PyQt6 GUI dashboard for Lenovo Legion laptops

Hardware backend: LLL (LenovoLegionLinux)

KDE Plasma 6 · Wayland — works on any Arch-based distro

LLL Backend: This toolkit uses LenovoLegionLinux (LLL) for all hardware control — power profiles, fan curves, battery conservation, overclocking, and more. The Python legion_linux library replaces direct sysfs access. Uses LLL's legiond daemon instead of a custom one.


🌐 Website

Visit our website: https://github.com/VVAT3R/legion-linux-toolkit

Learn more about features, supported hardware, and installation instructions.


📸 Screenshots

🏠 Home

Home

🔋 Battery                                           ⚡ Performance

🖥️ Display                                            ⌨️ Keyboard RGB

⚙️ System                                              🌀 Fan

🚀 Overclock                                         🎯 Actions

ℹ️ About

About


🖥️ Supported Hardware

Brand Models Support
🎮 Legion Legion 5, 5 Pro, 7, Slim 5/7 ✅ Full — RGB, OC, fan, G-Sync (via LLL)

Hardware support is determined by LLL (LenovoLegionLinux) kernel module. Only Legion/LOQ models with the legion_laptop kernel module are fully supported.


✨ Features

🏠 Home Page
  • ⚡ Power Mode dropdown — Quiet / Balanced / Performance / Custom (also Fn+Q)
  • 🔋 Battery Mode — Normal / Conservation (~60%) / Rapid Charge
  • 🎮 GPU Working Mode — Hybrid / NVIDIA / Integrated (via envycontrol)
  • 🔄 G-Sync & Display Overdrive toggles
  • 🔌 Always on USB & Fn Lock toggles
  • 📊 Live CPU, GPU & IC stats — utilization, clock, temp, fan RPM, VRAM
  • 🌡️ IC Temperature — Integrated Controller temp (when LLL loaded)
🔋 Battery Page
  • 📈 Live battery %, voltage, health, charge cycles, power draw, temperature
  • ⚙️ Conservation (~60%), Rapid Charge, USB Charging, Power Charge Mode
  • 🔧 ThinkPad only — Start/Stop charge threshold (e.g. 40%–80%)
🖥️ Display Page
  • ☀️ Screen brightness slider — auto-detects nvidia_wmi_ec_backlight, amdgpu_bl0 etc.
  • 📐 Resolution & Refresh Rate selectors (independent, via kscreen)
  • ✨ Display Overdrive & G-Sync toggles
⌨️ Keyboard RGB (Legion)
  • 🌈 4-zone RGB via LegionAura — Static, Breath, Wave, Hue, Off
  • 🎨 Per-zone colour pickers + hex input
  • 💡 Quick presets — Legion Red, Ocean, Sunset, Aurora
  • 🔆 Keyboard backlight brightness slider
⚙️ System Page
  • 🔒 Fn Lock, Super Key, Touchpad, Camera toggles
  • 🎨 Theme — Dark / Dark Dimmed / OLED Black / Light
  • 🔴 ThinkPad only — TrackPoint sensitivity & speed sliders
  • 💡 ThinkPad only — ThinkLight & Mic Mute LED toggles
  • 🔄 Yoga only — Hinge mode display, orientation lock toggle
🌀 Fan Page
  • 🎡 Animated fan icons — real-time spin driven by actual RPM
  • 🌡️ Auto mode — firmware thermal curves
  • 💨 Full Speed mode — locks both fans to 100%
  • 📊 LLL status — shows if LenovoLegionLinux driver is loaded
  • Fan curve info — displays custom curve availability (when LLL loaded)
  • 🔌 Kernel 7.x handling — graceful fallback on newer kernels
  • 🌀 ThinkPad only — Fan level dropdown (0–7, Auto, Disengaged)
🚀 Overclock Page
  • 🔛 Master OC enable/disable toggle
  • 🔧 CPU max/min frequency + TDP (PL1/PL2) sliders
  • 🎮 GPU core offset, memory offset, power limit, temp target

🌍 Languages

First-run wizard — choose your language on first launch:

🇬🇧 English · 🇫🇷 Français · 🇩🇪 Deutsch · 🇪🇸 Español · 🇵🇹 Português · 🇹🇷 Türkçe · 🇷🇺 Русский · 🇨🇳 中文 · 🇯🇵 日本語 · 🇰🇷 한국어 · 🇸🇦 العربية


🎨 Power Profiles

Profile Label LED TDP
low-power Quiet 🔵 Blue 15W
balanced Balanced ⚪ White 35W
balanced-performance Performance 🔴 Red 45W
performance Custom 🩷 Pink 54W

📦 Requirements

Core — auto-installed:

python-pyqt6   qt6-wayland   libnotify   kscreen   git

Optional — auto-installed by brand:

Package Manager Brand Feature
lenovolegionlinux + lenovolegionlinux-dkms pacman Legion / LOQ Fan RPM, IC temp, custom fan curve
envycontrol paru Legion / LOQ GPU mode switching
legionaura yay Legion Keyboard RGB
fprintd pacman ThinkPad / Yoga Fingerprint
iio-sensor-proxy pacman Yoga Auto-rotate

⚠️ Kernel Compatibility: The toolkit automatically detects if LLL works on your kernel. If not supported, it shows a message in the Fan page — auto-updates when LLL adds support.


🚀 Install

Prerequisites

  • Arch-based distro (Arch, CachyOS, EndeavourOS, Manjaro)
  • LLL kernel module: lenovolegionlinux + lenovolegionlinux-dkms from AUR/repos

Quick Install

git clone https://github.com/VVAT3R/legion-linux-toolkit
cd legion-linux-toolkit
sudo bash install.sh

The installer will:

  1. Install PyQt6 and other dependencies
  2. Install LLL (LenovoLegionLinux) packages from repos or AUR
  3. Install the GUI, tray app, and CLI wrapper
  4. Set up autostart for the tray
  5. Enable LLL's legiond daemon

🔄 Update

sudo bash update.sh

Pulls latest toolkit code, reinstalls files.


🗑️ Uninstall

sudo bash uninstall.sh

🛠️ Architecture

This is the LLL backend version of Legion Linux Toolkit. All hardware control is delegated to LenovoLegionLinux:

Component LLT Custom (removed) LLL (used now)
Daemon legion-daemon.py (Python) legiond (C)
CLI legion-ctl → daemon legion-ctllegion_cli
Kernel module Direct sysfs reads legion_laptop.ko
Python library Direct sysfs writes legion_linux.LegionModelFacade
Fan curve Debugfs via pkexec FanCurveIO
Power profiles Custom daemon PlatformProfileFeature
Overclocking Direct sysfs CPUOverclock, GPUOverclock, etc.

📄 License

MIT — free to use, modify and distribute.


· PyQt6 GUI + LLL backend ·

About

A native Linux power management dashboard for Lenovo Legion laptops — power profiles, RGB keyboard, fan control, OC, battery management and system tray. Built for CachyOS / Arch + KDE Plasma 6.

Resources

License

Stars

Watchers

Forks

Contributors