Skip to content

Commit 42152bd

Browse files
committed
feat(desktop-environment): add plasma home module
Declarative Plasma customization matching the repo's theming system: catppuccin color scheme/look-and-feel from the shared flavor/accent options, wallpaper via khanelinix.theme.wallpaper, gtk cursor theme, and a floating bottom panel with configurable pinned launchers.
1 parent e4683ee commit 42152bd

1 file changed

Lines changed: 103 additions & 0 deletions

File tree

  • modules/home/programs/graphical/desktop-environment/plasma
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
{
2+
config,
3+
lib,
4+
pkgs,
5+
6+
...
7+
}:
8+
let
9+
inherit (lib) mkIf types;
10+
inherit (lib.khanelinix) mkOpt;
11+
12+
cfg = config.khanelinix.programs.graphical.desktop-environment.plasma;
13+
catppuccinCfg = config.khanelinix.theme.catppuccin;
14+
cursorCfg = config.khanelinix.theme.gtk.cursor;
15+
16+
capitalize = s: lib.toUpper (builtins.substring 0 1 s) + builtins.substring 1 (-1) s;
17+
18+
wallpaperPath = name: lib.khanelinix.theme.wallpaperPath { inherit config pkgs name; };
19+
in
20+
{
21+
options.khanelinix.programs.graphical.desktop-environment.plasma = {
22+
enable = lib.mkEnableOption "KDE Plasma desktop environment customization";
23+
24+
panel = {
25+
launchers = mkOpt (types.listOf types.str) [
26+
"applications:org.kde.dolphin.desktop"
27+
"applications:org.kde.konsole.desktop"
28+
"applications:firefox.desktop"
29+
"applications:steam.desktop"
30+
] "Apps pinned to the panel task manager.";
31+
};
32+
};
33+
34+
config = mkIf cfg.enable {
35+
home.packages = lib.optionals catppuccinCfg.enable [
36+
(pkgs.catppuccin-kde.override {
37+
flavour = [ catppuccinCfg.flavor ];
38+
accents = [ catppuccinCfg.accent ];
39+
})
40+
];
41+
42+
programs.plasma = {
43+
enable = true;
44+
45+
workspace = {
46+
wallpaper = wallpaperPath config.khanelinix.theme.wallpaper.primary;
47+
48+
colorScheme = mkIf catppuccinCfg.enable "Catppuccin${capitalize catppuccinCfg.flavor}${capitalize catppuccinCfg.accent}";
49+
lookAndFeel = mkIf catppuccinCfg.enable "Catppuccin-${capitalize catppuccinCfg.flavor}-${capitalize catppuccinCfg.accent}";
50+
51+
cursor = mkIf (cursorCfg.name != null) {
52+
theme = cursorCfg.name;
53+
inherit (cursorCfg) size;
54+
};
55+
};
56+
57+
panels = [
58+
{
59+
location = "bottom";
60+
height = 48;
61+
floating = true;
62+
widgets = [
63+
{
64+
kickoff = {
65+
icon = "nix-snowflake-white";
66+
};
67+
}
68+
{
69+
iconTasks = {
70+
inherit (cfg.panel) launchers;
71+
};
72+
}
73+
"org.kde.plasma.marginsseparator"
74+
{
75+
systemTray.items.shown = [
76+
"org.kde.plasma.volume"
77+
"org.kde.plasma.networkmanagement"
78+
"org.kde.plasma.bluetooth"
79+
];
80+
}
81+
{
82+
digitalClock = {
83+
calendar.firstDayOfWeek = "sunday";
84+
time.format = "12h";
85+
};
86+
}
87+
"org.kde.plasma.showdesktop"
88+
];
89+
}
90+
];
91+
92+
kwin = {
93+
effects = {
94+
desktopSwitching.animation = "slide";
95+
minimization.animation = "squash";
96+
};
97+
};
98+
99+
# Double-tap Meta opens the launcher; Meta+W matches GNOME-style overview
100+
shortcuts.kwin."Overview" = "Meta+W";
101+
};
102+
};
103+
}

0 commit comments

Comments
 (0)