Lenovo Legion laptops expose their thermal mode through /sys/firmware/acpi/platform_profile.
Fn+Q usually cycles the firmware profiles, but Lenovo changed the Linux-facing names for the red
and purple slots in newer kernels.
This script watches platform_profile, treats each firmware change as an Fn+Q press, and applies
its own 4-step cycle so the hidden purple slot stays reachable from the keyboard.
The script now auto-detects which kernel ABI is present:
- Legacy mapping:
low-power → balanced → balanced-performance → performance - Current mapping:
low-power → balanced → performance → max-power
custom is left alone and is not part of the Fn+Q override cycle.
Current Lenovo Gamezone docs describe the modern profile names like this:
low-power→ blue LEDbalanced→ white LEDperformance→ red LEDmax-power→ purple LEDcustom→ purple LED
Older kernels exposed the same red and purple slots like this:
balanced-performance→ red LEDperformance→ purple LED
The script maps both layouts to the same logical order:
blue → white → red → purple → blue
Lenovo's Gamezone driver used to expose the red and purple firmware slots with confusing Linux names on some Legion models:
- BIOS
Performanceshowed up asbalanced-performance - BIOS
Extremeshowed up asperformance
That meant the LED colors and Linux profile names did not line up cleanly.
Newer kernels switched the Gamezone driver to expose the purple Extreme slot as max-power
instead of overloading performance. Current kernel documentation now describes the mapping as:
low-power→ blue LEDbalanced→ white LEDperformance→ red LEDmax-power→ purple LEDcustom→ purple LED
This project handles both layouts, so the same Fn+Q override logic works on older and newer kernels.
- A Lenovo Legion laptop that exposes
platform_profile - A kernel with
CONFIG_ACPI_PLATFORM_PROFILE - A kernel that also exposes
platform_profile_choices
Check support with:
ls /sys/firmware/acpi/platform_profile
cat /sys/firmware/acpi/platform_profile_choicesIf either sysfs file is missing, this tool will not work on that machine.
inotifywaitfrominotify-tools
Install it per distro:
- Arch / Manjaro / EndeavourOS
sudo pacman -S inotify-tools- Debian / Ubuntu / Pop!_OS / Mint
sudo apt install inotify-tools- Fedora
sudo dnf install inotify-toolsThe recommended path is the installer, because systemd runs the copy in /usr/local/sbin.
Editing the repo file alone does not update the installed service.
Run:
./install.shThe installer prompts for install or uninstall, copies the current script into place, installs
the tracked systemd unit, reloads systemd, and starts or removes the service.
Install dependencies
Install inotify-tools as shown above for your distro.
Copy the script
Place the script somewhere root-owned and executable, for example:
sudo mkdir -p /usr/local/sbin
sudo cp legion-fnq-override.sh /usr/local/sbin/legion-fnq-override.sh
sudo chmod +x /usr/local/sbin/legion-fnq-override.sh/var/lib/legion-fnq-state will be created automatically by the script if needed.
Install the systemd service
Create /etc/systemd/system/legion-fnq-override.service:
[Unit]
Description=Override Lenovo Legion Fn+Q to 4-step platform_profile cycle
After=multi-user.target
[Service]
Type=simple
ExecStart=/usr/local/sbin/legion-fnq-override.sh
[Install]
WantedBy=multi-user.targetThen reload and enable:
sudo systemctl daemon-reload
sudo systemctl enable --now legion-fnq-override.serviceCheck status with:
systemctl status legion-fnq-override.serviceThe service should stay active (running) with no write errors.
If the service is already installed and the repo script changed, reinstall it. A running systemd
service will keep using the old copy until /usr/local/sbin/legion-fnq-override.sh is replaced
and the unit is restarted.
Avoid running other tools that constantly write to platform_profile, because they will race the
override logic.
Common examples:
sudo systemctl disable --now auto-cpufreq.service
sudo systemctl disable --now tlp.service
sudo systemctl disable --now dynamic_power.serviceWatch the current profile:
watch -n0.2 cat /sys/firmware/acpi/platform_profileThen press Fn+Q repeatedly.
Expected sequence on newer kernels:
low-power
balanced
performance
max-power
low-power
Expected sequence on older kernels:
low-power
balanced
balanced-performance
performance
low-power