Skip to content

Commit

Permalink
feat(workspace): add support for wallpaper fill mode for wallpaper op…
Browse files Browse the repository at this point in the history
…tion (#344)
  • Loading branch information
HeitorAugustoLN authored Oct 15, 2024
1 parent ae9043d commit a9960fe
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions modules/workspace.nix
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,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 Expand Up @@ -409,7 +408,7 @@ in
# gives us the correct behavior with last_run files.
text = "// Wallpaper to set later: ${cfg.workspace.wallpaper}";
postCommands = ''
plasma-apply-wallpaperimage ${cfg.workspace.wallpaper}
plasma-apply-wallpaperimage ${cfg.workspace.wallpaper} ${lib.optionalString (cfg.workspace.wallpaperFillMode != null) "--fill-mode ${cfg.workspace.wallpaperFillMode}"}
'';
priority = 3;
}
Expand All @@ -430,7 +429,7 @@ in
${
lib.optionalString (
cfg.workspace.wallpaperFillMode != null
) ''desktop.writeConfig("FillMode", "${cfg.workspace.wallpaperFillMode}");''
) ''desktop.writeConfig("FillMode", "${toString wallpaperFillModeTypes.${cfg.workspace.wallpaperFillMode}}");''
}
}
'';
Expand Down Expand Up @@ -474,7 +473,7 @@ in
${
lib.optionalString (
cfg.workspace.wallpaperFillMode != null
) ''desktop.writeConfig("FillMode", "${cfg.workspace.wallpaperFillMode}");''
) ''desktop.writeConfig("FillMode", "${toString wallpaperFillModeTypes.${cfg.workspace.wallpaperFillMode}}");''
}
}
'';
Expand Down

0 comments on commit a9960fe

Please sign in to comment.