From 5d2657ba3db366c3be9bdfcc1bbe0967b993795b Mon Sep 17 00:00:00 2001 From: Satria Date: Sat, 14 Feb 2026 10:54:58 +0700 Subject: [PATCH] power setting tweaks --- modules/hardware/misc/cpu-thermal.nix | 34 ++++++++++++++++++++------- modules/home/rice/waybar.nix | 4 ++-- 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/modules/hardware/misc/cpu-thermal.nix b/modules/hardware/misc/cpu-thermal.nix index 87f0319..6aa804c 100644 --- a/modules/hardware/misc/cpu-thermal.nix +++ b/modules/hardware/misc/cpu-thermal.nix @@ -1,19 +1,35 @@ { ... }: { services = { - thermald.enable = true; + thermald.enable = false; throttled.enable = true; tlp = { enable = true; settings = { - CPU_SCALING_GOVERNOR_ON_AC = "performance"; - CPU_ENERGY_PERF_POLICY_ON_AC = "performance"; - CPU_BOOST_ON_AC = "1"; + TLP_DEFAULT_MODE = "BAL"; - CPU_SCALING_GOVERNOR_ON_BAT = "powersave"; - CPU_ENERGY_PERF_POLICY_ON_BAT = "power"; - CPU_BOOST_ON_BAT = "0"; - CPU_MAX_FREQ_ON_BAT = "1500000"; - CPU_MIN_FREQ_ON_BAT = "400000"; + CPU_SCALING_GOVERNOR_ON_PRF = "performance"; + CPU_ENERGY_PERF_POLICY_ON_PRF = "performance"; + CPU_BOOST_ON_PRF = "1"; + PLATFORM_PROFILE_ON_PRF = "performance"; + + CPU_SCALING_GOVERNOR_ON_BAL = "powersave"; + CPU_ENERGY_PERF_POLICY_ON_BAL = "balance_power"; + CPU_BOOST_ON_BAL = "0"; + PLATFORM_PROFILE_ON_BAL = "balanced"; + + CPU_SCALING_GOVERNOR_ON_SAV = "powersave"; + CPU_ENERGY_PERF_POLICY_ON_SAV = "power"; + CPU_BOOST_ON_SAV = "0"; + CPU_MAX_FREQ_ON_SAV = "1200000"; + CPU_MIN_FREQ_ON_SAV = "400000"; + CPU_MIN_PERF_ON_SAV = "40"; + CPU_MAX_PERF_ON_SAV = "80"; + PLATFORM_PROFILE_ON_SAV = "low-power"; + MEM_SLEEP_ON_SAV = "deep"; + + WOL_DISABLE = "N"; + DEVICES_TO_DISABLE_ON_STARTUP = "bluetooth wwan"; + DEVICES_TO_ENABLE_ON_STARTUP = "wifi"; START_CHARGE_THRESH_BAT0 = "80"; STOP_CHARGE_THRESH_BAT0 = "85"; diff --git a/modules/home/rice/waybar.nix b/modules/home/rice/waybar.nix index 829a0cc..5fe76b4 100644 --- a/modules/home/rice/waybar.nix +++ b/modules/home/rice/waybar.nix @@ -45,8 +45,8 @@ interval = 1; format = " {usage:2}% {avg_frequency}GHz"; on-click = "auto-cpufreq-gtk"; - on-click-right = "pkexec systemctl restart thermald throttled && notify-send ${hostname} 'CPU Underclocking Restarted'"; - on-click-middle = "pkexec systemctl stop thermald throttled && notify-send ${hostname} 'CPU Underclocking Stopped'"; + on-click-right = "pkexec tlp power-saver && notify-send ${hostname} \"TLP set to: $(tlp-stat -s | grep 'Power profile' | awk -F '=' '{print $2}' | xargs)\""; + on-click-middle = "pkexec tlp start && notify-send ${hostname} \"TLP set to: $(tlp-stat -s | grep 'Power profile' | awk -F '=' '{print $2}' | xargs)\""; }; "memory" = { states = {