KDE Power profiles are now managed by a separate file, so it is easier to select between them without changing theme.
This commit is contained in:
@ -44,5 +44,6 @@
|
|||||||
samba
|
samba
|
||||||
kdePackages.ksshaskpass
|
kdePackages.ksshaskpass
|
||||||
ntfs3g
|
ntfs3g
|
||||||
|
appimage-run
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,9 +2,9 @@
|
|||||||
{
|
{
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
./themes/common.nix
|
./settings/common.nix
|
||||||
|
./settings/powerProfile.nix
|
||||||
]
|
]
|
||||||
++ lib.optionals (plasmaTheme == "laptop") [ ./themes/laptop.nix ]
|
++ lib.optionals (plasmaTheme == "laptop") [ ./settings/laptop.nix ]
|
||||||
++ lib.optionals (plasmaTheme == "desktop") [ ./themes/desktop.nix ];
|
++ lib.optionals (plasmaTheme == "desktop") [ ./settings/desktop.nix ];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,6 +11,7 @@ let
|
|||||||
};
|
};
|
||||||
|
|
||||||
plasmaTheme = "desktop"; #Possible values are "laptop" or "desktop"
|
plasmaTheme = "desktop"; #Possible values are "laptop" or "desktop"
|
||||||
|
powerProfile = "laptop"; #Possible values are "laptop" or "desktop"
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
imports =
|
imports =
|
||||||
@ -21,7 +22,7 @@ in
|
|||||||
|
|
||||||
# Pass the variable to home-manager
|
# Pass the variable to home-manager
|
||||||
home-manager.extraSpecialArgs = {
|
home-manager.extraSpecialArgs = {
|
||||||
inherit plasmaTheme;
|
inherit plasmaTheme powerProfile;
|
||||||
};
|
};
|
||||||
|
|
||||||
home-manager.sharedModules = [
|
home-manager.sharedModules = [
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
programs = {
|
programs = {
|
||||||
plasma = {
|
plasma = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
overrideConfig = true;
|
||||||
shortcuts = {
|
shortcuts = {
|
||||||
# ActivityManager = {
|
# ActivityManager = {
|
||||||
# switch-to-activity-0f8d8349-5b1b-4b77-bfa5-22829bfaf459 = [ ];
|
# switch-to-activity-0f8d8349-5b1b-4b77-bfa5-22829bfaf459 = [ ];
|
||||||
@ -31,16 +32,16 @@
|
|||||||
# mic_mute = ["Microphone Mute" "Meta+Volume Mute"];
|
# mic_mute = ["Microphone Mute" "Meta+Volume Mute"];
|
||||||
# mute = "Volume Mute";
|
# mute = "Volume Mute";
|
||||||
# };
|
# };
|
||||||
kmserver = {
|
# kmserver = {
|
||||||
"Halt Without Confirmation" = [ ];
|
# "Halt Without Confirmation" = [ ];
|
||||||
"Lock Session" = ["Meta+L" "Screensaver"];
|
# "Lock Session" = ["Meta+L" "Screensaver"];
|
||||||
"Log Out" = "Ctrl+Alt+Del";
|
# "Log Out" = "Ctrl+Alt+Del";
|
||||||
"Log Out Without Confirmation" = [ ];
|
# "Log Out Without Confirmation" = [ ];
|
||||||
LogOut = [ ];
|
# LogOut = [ ];
|
||||||
Reboot = [ ];
|
# Reboot = [ ];
|
||||||
"Reboot Without Confirmation" = [ ];
|
# "Reboot Without Confirmation" = [ ];
|
||||||
"Shut Down" = [ ];
|
# "Shut Down" = [ ];
|
||||||
};
|
# };
|
||||||
kwin = {
|
kwin = {
|
||||||
# "Activate Window Demanding Attention" = "Meta+Ctrl+A";
|
# "Activate Window Demanding Attention" = "Meta+Ctrl+A";
|
||||||
Cube = "Meta+C";
|
Cube = "Meta+C";
|
||||||
@ -84,14 +84,6 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
# {
|
|
||||||
# name = "org.kde.plasma.battery";
|
|
||||||
# config = {
|
|
||||||
# General = {
|
|
||||||
# showPercentage = true;
|
|
||||||
# };
|
|
||||||
# };
|
|
||||||
# }
|
|
||||||
{
|
{
|
||||||
name = "org.kde.plasma.digitalclock";
|
name = "org.kde.plasma.digitalclock";
|
||||||
config = {
|
config = {
|
||||||
@ -105,53 +97,6 @@
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
powerdevil = {
|
|
||||||
# On AC power (plugged in): Minimal power saving
|
|
||||||
AC = {
|
|
||||||
powerProfile = "performance";
|
|
||||||
#turnOffDisplay.idleTimeout = 900; # 15 min idle
|
|
||||||
autoSuspend = {
|
|
||||||
action = "nothing";
|
|
||||||
};
|
|
||||||
dimDisplay.enable = false;
|
|
||||||
turnOffDisplay.idleTimeout = "never";
|
|
||||||
};
|
|
||||||
|
|
||||||
# Normal battery: Balanced saving
|
|
||||||
battery = {
|
|
||||||
powerProfile = "performance";
|
|
||||||
#turnOffDisplay.idleTimeout = 300; # 5 min
|
|
||||||
autoSuspend = {
|
|
||||||
action = "nothing";
|
|
||||||
};
|
|
||||||
whenLaptopLidClosed = "sleep";
|
|
||||||
dimDisplay.enable = false;
|
|
||||||
turnOffDisplay.idleTimeout = "never";
|
|
||||||
};
|
|
||||||
|
|
||||||
# Low battery (e.g., <10%): Critical actions
|
|
||||||
lowBattery = {
|
|
||||||
powerProfile = "performance";
|
|
||||||
autoSuspend = {
|
|
||||||
action = "sleep";
|
|
||||||
idleTimeout = 300; # 5 min idle
|
|
||||||
};
|
|
||||||
whenLaptopLidClosed = "sleep";
|
|
||||||
dimDisplay = {
|
|
||||||
idleTimeout = 60;
|
|
||||||
};
|
|
||||||
displayBrightness = 30; #Go to 30% display Brightness
|
|
||||||
turnOffDisplay.idleTimeout = 120;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Thresholds for "lowBattery" state
|
|
||||||
batteryLevels = {
|
|
||||||
lowLevel = 10;
|
|
||||||
criticalLevel = 5;
|
|
||||||
criticalAction = "sleep";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
workspace = {
|
workspace = {
|
||||||
theme = "WhiteSur-dark";
|
theme = "WhiteSur-dark";
|
||||||
colorScheme = "Win11OSDark";
|
colorScheme = "Win11OSDark";
|
||||||
@ -163,7 +108,7 @@
|
|||||||
soundTheme = "ocean";
|
soundTheme = "ocean";
|
||||||
iconTheme = "We10X";
|
iconTheme = "We10X";
|
||||||
splashScreen = {
|
splashScreen = {
|
||||||
theme = "com.github.yeyushengfan258.Win11OS-dark";
|
theme = "fishy";
|
||||||
};
|
};
|
||||||
windowDecorations = {
|
windowDecorations = {
|
||||||
library = "org.kde.kwin.aurorae";
|
library = "org.kde.kwin.aurorae";
|
||||||
@ -122,53 +122,6 @@
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
powerdevil = {
|
|
||||||
# On AC power (plugged in): Minimal power saving
|
|
||||||
AC = {
|
|
||||||
powerProfile = "powerSaving";
|
|
||||||
#turnOffDisplay.idleTimeout = 900; # 15 min idle
|
|
||||||
autoSuspend = {
|
|
||||||
action = "nothing";
|
|
||||||
};
|
|
||||||
dimDisplay.enable = false;
|
|
||||||
turnOffDisplay.idleTimeout = "never";
|
|
||||||
};
|
|
||||||
|
|
||||||
# Normal battery: Balanced saving
|
|
||||||
battery = {
|
|
||||||
powerProfile = "powerSaving";
|
|
||||||
#turnOffDisplay.idleTimeout = 300; # 5 min
|
|
||||||
autoSuspend = {
|
|
||||||
action = "nothing";
|
|
||||||
};
|
|
||||||
whenLaptopLidClosed = "sleep";
|
|
||||||
dimDisplay.enable = false;
|
|
||||||
turnOffDisplay.idleTimeout = "never";
|
|
||||||
};
|
|
||||||
|
|
||||||
# Low battery (e.g., <10%): Critical actions
|
|
||||||
lowBattery = {
|
|
||||||
powerProfile = "powerSaving";
|
|
||||||
autoSuspend = {
|
|
||||||
action = "sleep";
|
|
||||||
idleTimeout = 300; # 5 min idle
|
|
||||||
};
|
|
||||||
whenLaptopLidClosed = "sleep";
|
|
||||||
dimDisplay = {
|
|
||||||
idleTimeout = 60;
|
|
||||||
};
|
|
||||||
displayBrightness = 30; #Go to 30% display Brightness
|
|
||||||
turnOffDisplay.idleTimeout = 120;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Thresholds for "lowBattery" state
|
|
||||||
batteryLevels = {
|
|
||||||
lowLevel = 10;
|
|
||||||
criticalLevel = 5;
|
|
||||||
criticalAction = "sleep";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
workspace = {
|
workspace = {
|
||||||
theme = "WhiteSur-dark";
|
theme = "WhiteSur-dark";
|
||||||
colorScheme = "BreezeDark";
|
colorScheme = "BreezeDark";
|
||||||
65
plasma/settings/powerProfile.nix
Normal file
65
plasma/settings/powerProfile.nix
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
{pkgs, inputs, username, project, powerProfile, ...}:
|
||||||
|
let
|
||||||
|
profiles = {
|
||||||
|
laptop = {
|
||||||
|
AC.powerProfile = "powerSaving";
|
||||||
|
battery.powerProfile = "powerSaving";
|
||||||
|
lowBattery.powerProfile = "powerSaving";
|
||||||
|
};
|
||||||
|
desktop = {
|
||||||
|
AC.powerProfile = "performance";
|
||||||
|
battery.powerProfile = "performance";
|
||||||
|
lowBattery.powerProfile = "performance";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
selectedProfile = profiles.${powerProfile};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
programs = {
|
||||||
|
plasma = {
|
||||||
|
overrideConfig = true;
|
||||||
|
|
||||||
|
powerdevil = {
|
||||||
|
AC = {
|
||||||
|
powerProfile = selectedProfile.AC.powerProfile;
|
||||||
|
autoSuspend = {
|
||||||
|
action = "nothing";
|
||||||
|
};
|
||||||
|
dimDisplay.enable = false;
|
||||||
|
turnOffDisplay.idleTimeout = "never";
|
||||||
|
};
|
||||||
|
|
||||||
|
battery = {
|
||||||
|
powerProfile = selectedProfile.battery.powerProfile;
|
||||||
|
autoSuspend = {
|
||||||
|
action = "nothing";
|
||||||
|
};
|
||||||
|
whenLaptopLidClosed = "sleep";
|
||||||
|
dimDisplay.enable = false;
|
||||||
|
turnOffDisplay.idleTimeout = "never";
|
||||||
|
};
|
||||||
|
|
||||||
|
lowBattery = {
|
||||||
|
powerProfile = selectedProfile.lowBattery.powerProfile;
|
||||||
|
autoSuspend = {
|
||||||
|
action = "sleep";
|
||||||
|
idleTimeout = 300;
|
||||||
|
};
|
||||||
|
whenLaptopLidClosed = "sleep";
|
||||||
|
dimDisplay = {
|
||||||
|
idleTimeout = 60;
|
||||||
|
};
|
||||||
|
displayBrightness = 30;
|
||||||
|
turnOffDisplay.idleTimeout = 120;
|
||||||
|
};
|
||||||
|
|
||||||
|
batteryLevels = {
|
||||||
|
lowLevel = 10;
|
||||||
|
criticalLevel = 5;
|
||||||
|
criticalAction = "sleep";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user