Skip to content

Commit

Permalink
kde(style): fix formatting width
Browse files Browse the repository at this point in the history
  • Loading branch information
rkuklik committed Jan 18, 2025
1 parent 085308f commit 1d43263
Showing 1 changed file with 36 additions and 28 deletions.
64 changes: 36 additions & 28 deletions modules/kde/hm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ let
types
;

formatValue = value: if isBool value then if value then "true" else "false" else toString value;
formatValue =
value:
if isBool value then if value then "true" else "false" else toString value;

formatSection =
path: data:
Expand All @@ -45,7 +47,9 @@ let
directChildren = partitioned.right;
indirectChildren = partitioned.wrong;
in
optional (directChildren != [ ]) header ++ directChildren ++ flatten indirectChildren;
optional (directChildren != [ ]) header
++ directChildren
++ flatten indirectChildren;

formatLines =
path: data:
Expand All @@ -72,7 +76,9 @@ let
# PascalCase is the standard naming for color scheme files. Schemes named
# in kebab-case will load when selected manually, but don't work with a
# look and feel package.
colorschemeSlug = concatStrings (filter isString (builtins.split "[^a-zA-Z]" colors.scheme));
colorschemeSlug = concatStrings (
filter isString (builtins.split "[^a-zA-Z]" colors.scheme)
);

colorEffect = {
ColorEffect = 0;
Expand Down Expand Up @@ -326,29 +332,31 @@ in
};
};

config = mkIf (config.stylix.enable && cfg.enable && pkgs.stdenv.hostPlatform.isLinux) {
home = {
packages = [ themePackage ];

# This activation entry will run the theme activator when the homeConfiguration is activated
activation.stylixLookAndFeel = hm.dag.entryAfter [ "writeBoundary" ] ''
${activator} || verboseEcho \
"Stylix KDE theme setting failed. Note that it only works in an already running Plasma session."
'';
};

xdg = {
systemDirs.config = [ "${configPackage}" ];

# This desktop entry will run the theme activator when a new Plasma session is started
# Note: This doesn't run again if a new homeConfiguration is activated from a running Plasma session
configFile."autostart/stylix-activator.desktop".text = ''
[Desktop Entry]
Type=Application
Exec=${activator}
Name=Stylix Activator
X-KDE-AutostartScript=true
'';
};
};
config =
mkIf (config.stylix.enable && cfg.enable && pkgs.stdenv.hostPlatform.isLinux)
{
home = {
packages = [ themePackage ];

# This activation entry will run the theme activator when the homeConfiguration is activated
activation.stylixLookAndFeel = hm.dag.entryAfter [ "writeBoundary" ] ''
${activator} || verboseEcho \
"Stylix KDE theme setting failed. Note that it only works in an already running Plasma session."
'';
};

xdg = {
systemDirs.config = [ "${configPackage}" ];

# This desktop entry will run the theme activator when a new Plasma session is started
# Note: This doesn't run again if a new homeConfiguration is activated from a running Plasma session
configFile."autostart/stylix-activator.desktop".text = ''
[Desktop Entry]
Type=Application
Exec=${activator}
Name=Stylix Activator
X-KDE-AutostartScript=true
'';
};
};
}

0 comments on commit 1d43263

Please sign in to comment.