feat: nb battery improvement
This commit is contained in:
15
hosts/nb/modules/battery-brightness.nix
Normal file
15
hosts/nb/modules/battery-brightness.nix
Normal file
@@ -0,0 +1,15 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
# Udev rules for battery optimizations
|
||||
services.udev.extraRules = ''
|
||||
# Reduce brightness to 40% when switching to battery
|
||||
SUBSYSTEM=="power_supply", ATTR{online}=="0", RUN+="${pkgs.light}/bin/light -S 40"
|
||||
|
||||
# AMD GPU power management - force battery profile when unplugged
|
||||
SUBSYSTEM=="power_supply", ATTR{online}=="0", RUN+="${pkgs.bash}/bin/bash -c 'echo battery > /sys/class/drm/card*/device/power_dpm_force_performance_level'"
|
||||
|
||||
# AMD GPU power management - auto when plugged in
|
||||
SUBSYSTEM=="power_supply", ATTR{online}=="1", RUN+="${pkgs.bash}/bin/bash -c 'echo auto > /sys/class/drm/card*/device/power_dpm_force_performance_level'"
|
||||
'';
|
||||
}
|
||||
Reference in New Issue
Block a user