mirror of
https://github.com/nix-community/plasma-manager.git
synced 2024-09-11 09:55:26 +03:00
Add more persistent keys for colorschemes in kdeglobals (#180)
This commit is contained in:
parent
2636bb4c06
commit
41f42c35f5
47
lib/colorscheme.nix
Normal file
47
lib/colorscheme.nix
Normal file
@ -0,0 +1,47 @@
|
||||
{ lib, ... }:
|
||||
let
|
||||
colorEffectsKeys = [
|
||||
"ChangeSelectionColor"
|
||||
"Color"
|
||||
"ColorAmount"
|
||||
"ColorEffect"
|
||||
"ContrastAmount"
|
||||
"ContrastEffect"
|
||||
"Enable"
|
||||
"IntensityAmount"
|
||||
"IntensityEffect"
|
||||
];
|
||||
colorUIKeys = [
|
||||
"BackgroundAlternate"
|
||||
"BackgroundNormal"
|
||||
"DecorationFocus"
|
||||
"DecorationHover"
|
||||
"ForegroundActive"
|
||||
"ForegroundInactive"
|
||||
"ForegroundLink"
|
||||
"ForegroundNegative"
|
||||
"ForegroundNeutral"
|
||||
"ForegroundNormal"
|
||||
"ForegroundVisited"
|
||||
"regroundPositive"
|
||||
];
|
||||
ignoreKeys = {
|
||||
"ColorEffects:Disabled" = colorEffectsKeys;
|
||||
"ColorEffects:Inactive" = colorEffectsKeys;
|
||||
"Colors:Button" = colorUIKeys;
|
||||
"Colors:Selection" = colorUIKeys;
|
||||
"Colors:Tooltip" = colorUIKeys;
|
||||
"Colors:View" = colorUIKeys;
|
||||
"Colors:Window" = colorUIKeys;
|
||||
};
|
||||
in
|
||||
(lib.mkMerge
|
||||
(lib.mapAttrsToList
|
||||
(group: keys: {
|
||||
"kdeglobals"."${group}" = (lib.mkMerge
|
||||
(map
|
||||
(key:
|
||||
{ "${key}"."persistent" = (lib.mkDefault true); })
|
||||
keys));
|
||||
})
|
||||
ignoreKeys))
|
@ -171,13 +171,22 @@ in
|
||||
};
|
||||
# We add persistence to some keys in order to not reset the themes on
|
||||
# each generation when we use overrideConfig.
|
||||
programs.plasma.configFile = lib.mkIf (cfg.overrideConfig) {
|
||||
kcminputrc.Mouse.cursorTheme.persistent = lib.mkDefault (cfg.workspace.cursorTheme != null);
|
||||
kdeglobals.General.ColorScheme.persistent = lib.mkDefault (cfg.workspace.colorScheme != null);
|
||||
kdeglobals.Icons.Theme.persistent = lib.mkDefault (cfg.workspace.iconTheme != null);
|
||||
kdeglobals.KDE.LookAndFeelPackage.persistent = lib.mkDefault (cfg.workspace.lookAndFeel != null);
|
||||
plasmarc.Theme.name.persistent = lib.mkDefault (cfg.workspace.theme != null);
|
||||
};
|
||||
programs.plasma.configFile = lib.mkIf (cfg.overrideConfig) (
|
||||
let
|
||||
colorSchemeIgnore = if (cfg.workspace.colorScheme != null) then (import ../lib/colorscheme.nix { inherit lib; }) else { };
|
||||
in
|
||||
(lib.mkMerge
|
||||
[
|
||||
{
|
||||
kcminputrc.Mouse.cursorTheme.persistent = lib.mkDefault (cfg.workspace.cursorTheme != null);
|
||||
kdeglobals.General.ColorScheme.persistent = lib.mkDefault (cfg.workspace.colorScheme != null);
|
||||
kdeglobals.Icons.Theme.persistent = lib.mkDefault (cfg.workspace.iconTheme != null);
|
||||
kdeglobals.KDE.LookAndFeelPackage.persistent = lib.mkDefault (cfg.workspace.lookAndFeel != null);
|
||||
plasmarc.Theme.name.persistent = lib.mkDefault (cfg.workspace.theme != null);
|
||||
}
|
||||
colorSchemeIgnore
|
||||
])
|
||||
);
|
||||
})
|
||||
(lib.mkIf (cfg.workspace.wallpaper != null) {
|
||||
# We need to set the wallpaper after the panels are created in order for
|
||||
|
Loading…
Reference in New Issue
Block a user