Add support for customizable Plasma themes and configurations

- Introduced plasmaTheme variable in plasma.nix to allow selection between "desktop" and "laptop" themes.
- Created common theme configurations in common.nix, including keyboard shortcuts and application settings.
- Implemented desktop-specific configurations in desktop.nix, including panel layout, power management settings, and workspace appearance.
- Added laptop-specific configurations in laptop.nix, focusing on power-saving features and panel arrangements.
- Enhanced system monitoring widgets and battery management settings for both themes.
This commit is contained in:
2026-02-16 16:20:16 +01:00
parent 0305851bf4
commit 48378c963d
5 changed files with 788 additions and 563 deletions

199
plasma/themes/laptop.nix Normal file
View File

@ -0,0 +1,199 @@
{pkgs, inputs, username, project, plasmaTheme, ...}:
{
programs = {
plasma = {
overrideConfig = true;
panels = [
{
height = 44;
location = "top";
alignment = "center";
floating = true;
opacity = "translucent";
widgets = [
"org.kde.plasma.kickoff"
"org.kde.plasma.pager"
"org.kde.plasma.marginsseparator"
"org.kde.windowtitle"
"org.kde.plasma.panelspacer"
{
name = "org.kde.olib.thermalmonitor";
config = {
General = {
sensors = "[{\"name\":\"Average CPU Temperature\",\"sensorId\":\"cpu/all/averageTemperature\"}]";
};
};
}
{
name = "org.kde.plasma.systemmonitor.cpu";
config = {
Appearance = {
chartFace = "org.kde.ksysguard.linechart";
title = "Total CPU Use";
};
SensorColors = {
"cpu/all/usage" = "43,82,120";
};
Sensors = {
highPrioritySensorIds = "[\"cpu/all/usage\"]";
lowPrioritySensorIds = "[\"cpu/all/cpuCount\",\"cpu/all/coreCount\"]";
totalSensors = "[\"cpu/all/usage\"]";
};
General = {
CurrentPreset = "org.kde.plasma.systemmonitor";
};
};
}
"zayron.simple.separator"
{
systemTray = {
items = {
# Explicitly shown icons (always visible)
shown = [
"Trayscale"
#"org.kde.plasma.battery"
"org.kde.plasma.networkmanagement"
"org.kde.plasma.volume"
];
# Explicitly hidden icons (in the popup menu)
hidden = [
"org.kde.plasma.brightness"
"toolbox"
"Yakuake"
"org.kde.plasma.notifications"
"Xwayland Video Bridge_pipewireToXProxy"
"zero-trust-client"
"org.kde.plasma.clipboard"
"org.kde.plasma.bluetooth"
"org.kde.plasma.clipboard"
"org.kde.plasma.printmanager"
"org.kde.plasma.weather"
"org.kde.plasma.battery"
];
};
};
}
{
name = "org.kde.plasma.battery";
config = {
General = {
showPercentage = true;
};
};
}
{
name = "org.kde.plasma.digitalclock";
config = {
Appearance = {
fontWeight = 400;
use24hFormat = 2;
};
};
}
];
}
{
height = 60;
location = "bottom";
alignment = "center";
lengthMode = "fit";
floating = true;
opacity = "translucent";
hiding = "dodgewindows";
widgets = [
"org.kde.plasma.kickerdash"
{
name = "org.kde.plasma.icontasks";
config = {
General = {
launchers = [
# optional pinned apps
"applications:org.kde.dolphin.desktop"
"applications:systemsettings.desktop""applications:kitty.desktop"
"applications:firefox.desktop"
];
};
};
}
];
}
];
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 = {
theme = "WhiteSur-dark";
colorScheme = "BreezeDark";
cursor = {
theme = "Breeze_Light";
size = 24;
};
wallpaper = /home/${username}/${project}/other/wallpaper3.png;
soundTheme = "freedesktop";
iconTheme = "Breeze-LaCapitaine-apps";
splashScreen = {
theme = "a2n.kuro";
};
windowDecorations = {
library = "org.kde.kwin.aurorae";
theme = "__aurorae__svg__Nordic";
};
};
configFile = {
kwinrc = {
Effect-wobblywindows.AdvancedMode = true;
Effect-wobblywindows.Stiffness = 25;
Plugins.wobblywindowsEnabled = true;
};
};
};
};
}