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

175
plasma/themes/desktop.nix Normal file
View File

@ -0,0 +1,175 @@
{pkgs, inputs, username, project, plasmaTheme, ...}:
{
programs = {
plasma = {
overrideConfig = true;
panels = [
{
height = 44;
location = "bottom";
alignment = "center";
floating = true;
opacity = "translucent";
widgets = [
"org.kde.plasma.kickoff"
"org.kde.plasma.pager"
{
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"
];
};
};
}
{
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;
};
};
}
];
}
];
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 = {
theme = "WhiteSur-dark";
colorScheme = "Win11OSDark";
cursor = {
theme = "Win10OS-cursors";
size = 24;
};
wallpaper = /home/${username}/${project}/other/wallpaper1.png;
soundTheme = "ocean";
iconTheme = "We10X";
splashScreen = {
theme = "com.github.yeyushengfan258.Win11OS-dark";
};
windowDecorations = {
library = "org.kde.kwin.aurorae";
theme = "__aurorae__svg__Win11OS-dark";
};
};
};
};
}