Skip to content

Commit

Permalink
Add wallpaperFillMode support for wallpaper option
Browse files Browse the repository at this point in the history
  • Loading branch information
HeitorAugustoLN authored Aug 29, 2024
1 parent 5c97fe8 commit 0f0ca7f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 3 additions & 3 deletions modules/panels.nix
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ in
// Wallpaper to set later: ${cfg.workspace.wallpaper}
'' else "");
wallpaperPostCMD = (if (cfg.workspace.wallpaper != null) then ''
plasma-apply-wallpaperimage ${cfg.workspace.wallpaper}
plasma-apply-wallpaperimage ${cfg.workspace.wallpaper} ${lib.optionalString (cfg.workspace.wallpaperFillMode != null) "--fill-mode ${cfg.workspace.wallpaperFillMode}"}
'' else "");
wallpaperSlideShow = (if (cfg.workspace.wallpaperSlideShow != null) then ''
// Wallpaper slideshow
Expand All @@ -217,7 +217,7 @@ in
"\"" + (builtins.toString path) + "\"" else
"[" + (builtins.concatStringsSep "," (map (s: "\"" + s + "\"") path)) + "]"});
desktop.writeConfig("SlideInterval", "${builtins.toString cfg.workspace.wallpaperSlideShow.interval}");
${lib.optionalString (cfg.workspace.wallpaperFillMode != null) ''desktop.writeConfig("FillMode", "${cfg.workspace.wallpaperFillMode}");''}
${lib.optionalString (cfg.workspace.wallpaperFillMode != null) ''desktop.writeConfig("FillMode", "${toString wallpaperFillModeTypes.${cfg.workspace.wallpaperFillMode}}");''}
}
'' else "");
wallpaperPOTD = (if (cfg.workspace.wallpaperPictureOfTheDay != null) then ''
Expand All @@ -228,7 +228,7 @@ in
desktop.currentConfigGroup = ["Wallpaper", "org.kde.potd", "General"];
desktop.writeConfig("Provider", "${cfg.workspace.wallpaperPictureOfTheDay.provider}");
desktop.writeConfig("UpdateOverMeteredConnection", "${if (cfg.workspace.wallpaperPictureOfTheDay.updateOverMeteredConnection) then "1" else "0"}");
${lib.optionalString (cfg.workspace.wallpaperFillMode != null) ''desktop.writeConfig("FillMode", "${cfg.workspace.wallpaperFillMode}");''}
${lib.optionalString (cfg.workspace.wallpaperFillMode != null) ''desktop.writeConfig("FillMode", "${toString wallpaperFillModeTypes.${cfg.workspace.wallpaperFillMode}}");''}
}
'' else "");
wallpaperPlainColor = (if (cfg.workspace.wallpaperPlainColor != null) then ''
Expand Down
3 changes: 1 addition & 2 deletions modules/workspace.nix
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,8 @@ in
example = "stretch";
description = ''
Defines how the wallpaper should be displayed on the screen.
Applies only to wallpaperPictureOfTheDay or wallpaperSlideShow.
Applies only to wallpaper, wallpaperPictureOfTheDay or wallpaperSlideShow.
'';
apply = value: if value == null then null else (builtins.toString wallpaperFillModeTypes.${value});
};

soundTheme = lib.mkOption {
Expand Down

0 comments on commit 0f0ca7f

Please sign in to comment.