Omahub
← All plugins
G

Power Mode Controller

by Ghosthunter5599

Dynamic CPU/GPU Power Profile Switcher, RAPL Wattage Tuner & Hardware Telemetry

Security review

Potentially dangerous behavior detected · 3 findings

Deterministic scan — not a security guarantee

High
Risk level
High
Analyzed commit
e042e72
Scanned
1 month ago
  • Bundles a systemd unit file.

    [Unit]
  • Docs external_hosts README.md:108

    Downloads or connects to an external HTTP(S) host.

    git clone https://github.com/Ghosthunter5599/power-mode.git
  • Docs sudo README.md:116

    Command runs with sudo, elevating the process beyond the plugin environment.

    sudo rm -f /usr/local/bin/power-mode ~/.local/bin/power-mode

Automated analysis only — not a security guarantee.

AI advisory review

Review recommended

Language-model assessment · ~deepseek/deepseek-v4-flash-latest — advisory only

Medium
AI risk level
Medium
Recommendation
review
Model
~deepseek/deepseek-v4-flash-latest
Analyzed commit
e042e72
Reviewed
1 month ago

The plugin is a legitimate power management tool that interacts with system hardware via sysfs and requires root privileges for full functionalityastra. The deterministic scan flagged the README's external host and sudo commands, but these are documentation-only and not part of the plugin's executable code. The bundled systemd unit file is a real persistence mechanism, but it only runs a benign command to set a balanced power profile on boot, which is clearly disclosed in the README. The main risk is that the plugin executes 'power-mode' commands from the widget, which could alter system power settings without explicit user consent if the user is not aware of the implications.

  • The plugin includes a systemd unit file that runs 'power-mode --balanced' on boot, which modifies CPU/GPU power limits without user interaction; this is a persistence mechanism that could affect system stability or hardware if misconfigured.
  • The widget's QML code executes 'power-mode' commands (e.g., '--gpu', '--custom') when the user clicks buttons, which can change power limits; this is expected functionality but requires root privileges and could be misused if the user is not careful.
  • The deterministic scan flagged the README's 'git clone' and 'sudo rm' commands, but these are documentation examples and not part of the plugin's executable code; they do not pose a direct risk to users installing via the registry.
  • The plugin's install.sh script copies files to system directories and optionally installs the Omarchy plugin, but it does not perform any destructive or malicious actions; it is straightforward and transparent.
How this check works

This review combines the deterministic scan (the rule-based results above) with an independent look at the plugin's code by a language model. The model reads a trimmed sample of the repository's files, the manifest, and the README, then gives a plain-language risk level and a recommendation: install (no notable danger), review (look closer first), or avoid (clearly dangerous).

It runs on the same analyzed commit as the deterministic scan and is strictly advisory — it is not a security guarantee and never blocks a plugin by itself. A human moderator still reviews plugins before they are listed.

AI advisory only — automated analysis, not a security guarantee.

Install
$ omarchy plugin add https://github.com/Ghosthunter5599/power-mode --enable
Hardware #quickshell #power-management #system

⚡ power-mode

License: MIT Platform: Linux Zero Dependencies Hardware: Intel | AMD | NVIDIA

Universal Linux Dynamic CPU/GPU Power Profiler, Package Power Orchestrator & Telemetry Manager.

<p align="center"> <img src="assets/preview.png" alt="Power Mode Quickshell Popup Panel" width="460"> </p>

power-mode is a lightweight, zero-dependency Linux tool that synchronously controls Intel RAPL (PL1/PL2) sustained wattages, CPU Energy Performance Preferences (EPP), ACPI Platform Profiles, and NVIDIA Discrete GPU TGP from a unified Terminal UI (TUI), CLI, or desktop top-bar widget.


🎯 Why This Tool Exists & Who Needs It

🔍 The Core Problem: Shared Laptop Cooling & Total Power Limits

In modern laptops (especially gaming and mobile workstation laptops), the CPU and GPU share the same copper heat pipes, vapor chamber, and exhaust fin arrays. Furthermore, laptops operate under a strict Total Power Budget constrained by the AC power adapter (e.g., 170W – 230W) and internal VRM thermal limits.

When both the CPU and GPU attempt to boost simultaneously under demanding tasks:

  1. Thermal Cross-Talk: Heat from an aggressively boosting CPU saturates the shared heat pipes, heating up the GPU (and vice versa).
  2. Thermal Throttling: Both chips hit their 95°C–100°C thermal ceilings and aggressively downclock, resulting in frame stutter, dropped clock speeds, and loud fan noise.
  3. Power Starvation: The CPU may draw 85W+ on minor background threads while the GPU is starved of electrical wattage, dropping GPU graphics performance.

💡 The Solution: Active Thermal & Electrical Budget Balancing

By actively regulating and capping the power draw of the idle or less-critical component, you free up both electrical wattage and thermal cooling headroom for the component that actually needs it:

  • 🎮 Gaming & 3D Rendering (GPU-Bound):
    • By constraining the CPU from 85W down to 35W (which is plenty for games), CPU temperature drops by 15°C–25°C.
    • This newly freed cooling capacity allows the NVIDIA GPU to sustain its maximum 95W–140W Dynamic Boost clock without thermal throttling or frame drops.
  • ⚙️ Code Compilation, Physics & Data Science (CPU-Bound):
    • By capping the GPU to 30W–40W, the laptop can deliver 85W–115W sustained all-core Turbo Boost to the CPU, drastically cutting compilation and computation times.
  • 🔋 On Battery / Light Workloads:
    • Capping both silicon chips to low power envelopes eliminates background spikes, ensures near-silent fans, and doubles battery life.

👥 Who Is This For?

  • Laptop Gamers & 3D Artists: Stop CPU thermal throttling from killing GPU frame rates in heavy 3D games and Unreal/Blender rendering.
  • Software Developers & Engineers: Maximize sustained multi-core CPU compilation performance (Rust, C++, Linux kernel builds) without heat saturation.
  • Machine Learning & Data Practitioners: Run local LLM inference or CPU training on laptops with consistent, un-throttled thermal stability.
  • Linux Laptop Power Users: Anyone who wants fine-grained, on-the-fly control over their hardware without depending on bloated proprietary OEM software.

🌟 Key Features

  • 🔬 Zero Dependencies: Built entirely using Python's standard library (curses, sysfs, subprocess). Runs out of the box on any Linux distribution (Arch, Fedora, Ubuntu, Debian, CachyOS, Void, NixOS).
  • 🧠 Adaptive Hardware Probing:
    • GPU Detected: Generates specialized high-performance GPU profiles (GPU Max, Balanced, CPU Compute, Eco).
    • No GPU (Integrated / Headless / CPU Machines): Automatically detects GPU absence and generates CPU ML Training / High-Compute Modes (uncapped sustained PL1/PL2, performance governor, all cores max boost).
    • CachyOS Kernel Detection: Detects CachyOS kernels (BORE/EEVDF schedulers) and generates ultra-low-latency high-throughput scheduler profiles.
  • 🎮 Simulation / Dry-Run Mode (--simulate / --dry-run):
    • Test hardware detection, probe RAPL limits, and preview profile adjustments without requiring root permissions or altering system state.
  • ⚙️ Interactive Custom Tuner:
    • Live $ \leftarrow / \rightarrow $ wattage sliders in 5W increments to dial in exact CPU sustained (PL1) and GPU TGP limits.
  • 🖥️ Desktop Widget Extensions:
    • Includes ready-to-use plugins for Omarchy / Quickshell popup panels and Waybar.

📋 Profile Matrix

1. Devices with Dedicated NVIDIA GPU

Profile CPU PL1 (Sustained) CPU PL2 (Burst) GPU Power Limit (TGP) CPU Governor (EPP) ACPI Profile Target Workload
GPU 35 W 55 W 95 W (MAX) performance performance AAA Gaming & GPU ML Training (Keeps CPU cool so GPU boosts to maximum)
CACHYOS (if detected) 85 W 162 W 95 W (MAX) performance performance CachyOS Gaming & Throughput (BORE scheduler with maximum all-round power)
BALANCED 25 W 45 W 60 W balance_performance balanced Daily Multitasking & Browsing (Balanced thermal curve & quiet fans)
CPU 85 W 162 W 40 W performance performance Physics Simulation & Compilation (Max CPU cores for simulations & Rust/C++ builds)
ECO 15 W 25 W MIN (~35W) power low-power Maximum Battery Life & Silent Operation

2. Devices without Dedicated GPU (Integrated / CPU-Only)

Profile CPU PL1 (Sustained) CPU PL2 (Burst) CPU Governor (EPP) ACPI Profile Target Workload
ML_TRAIN 95 W 165 W performance performance Local LLMs, PyTorch/TensorFlow CPU training, data science
CACHYOS (if detected) 85 W 140 W performance performance All-core low-latency task scheduling on CachyOS
BALANCED 45 W 75 W balance_performance balanced General development and multitasking
ECO 15 W 25 W power low-power Battery conservation, silent operation

🚀 Installation & Removal

1. As an Omarchy Shell Plugin (Recommended for Omarchy Users)

To install and enable the top-bar widget and popup panel directly via Omarchy's plugin manager:

omarchy plugin add https://github.com/Ghosthunter5599/power-mode --enable

To remove the plugin:

omarchy plugin remove ghosthunter5599.power-mode

2. Standalone Linux Installation (Any Distribution)

To install the universal CLI and interactive TUI on any Linux system (Arch, Fedora, Ubuntu, Debian, Void, NixOS, CachyOS):

git clone https://github.com/Ghosthunter5599/power-mode.git
cd power-mode
chmod +x install.sh
./install.sh

To uninstall:

sudo rm -f /usr/local/bin/power-mode ~/.local/bin/power-mode

💻 CLI Usage

# Launch interactive Curses TUI
power-mode

# Run in simulation / dry-run mode (no root needed)
power-mode --simulate

# View live telemetry in JSON format (ideal for status bars)
power-mode --json

# View live hardware status
power-mode --status

# Switch profiles directly from terminal / keybindings
power-mode --gpu
power-mode --cachy
power-mode --balanced
power-mode --cpu
power-mode --ml_train
power-mode --eco

# Apply custom wattages directly (CPU PL1 in Watts, GPU TGP in Watts)
power-mode --custom 65 80

🧩 Desktop Integrations

Omarchy / Quickshell

The repository includes a mouse-interactive popup panel extension under extensions/omarchy-quickshell/. To install:

mkdir -p ~/.config/omarchy/plugins/local.power-mode
cp -r extensions/omarchy-quickshell/* ~/.config/omarchy/plugins/local.power-mode/

Add "local.power-mode" to your ~/.config/omarchy/shell.json inside bar.layout.right.

Waybar

Add the custom module snippet from extensions/waybar/config.jsonc to your ~/.config/waybar/config.jsonc.


⚠️ Safety Disclaimer & Thermal Limits

  • power-mode interacts with Linux kernel sysfs interfaces (intel-rapl, cpufreq) and NVIDIA driver power management.
  • Always ensure your laptop or PC has adequate cooling and is connected to a power supply with sufficient wattage capacity when utilizing high-power profiles.
  • Hardware safety guards (thermal throttling trips and OEM firmware ceilings) remain active in the hardware controller.

📄 License

MIT © Ghosthunter5599