Skip to content

Commit

Permalink
hyprpaper: init (#377)
Browse files Browse the repository at this point in the history
Initialize the 'hyprpaper' module.

In the future, it might be possible to 'unload' the one-off wallpaper to reduce
the running memory usage [1]:

> Preload does exactly what it says. It loads the entire wallpaper into
> memory. This can result in around 8 - 20MB of mem usage. It is not
> recommended to preload every wallpaper you have, as it will be a)
> taking a couple seconds at the beginning to load and b) take 100s of
> MBs of disk and RAM usage.
>
> Preload is meant only for situations in which you want a wallpaper to
> switch INSTANTLY when you issue a wallpaper keyword (e.g. wallpaper
> per workspace)
>
> In any and all cases when you don't mind waiting 300ms for the
> wallpaper to change, consider making a script that:
>  - preloads the new wallpaper
>  - sets the new wallpaper
>  - unloads the old wallpaper (to free memory)
>
> -- Hyprpaper [2]

[1]: #408
[2]: https://github.com/hyprwm/hyprpaper/blob/678d0e8959cf7adbc3825d578595e82305573991/README.md?plain=1#L103-L111

Co-authored-by: NAHO <[email protected]>
  • Loading branch information
edrobertsrayne and trueNAHO authored Jun 17, 2024
1 parent 80e8e1e commit f13c946
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 5 deletions.
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions modules/hyprland/hm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ in {
options.stylix.targets.hyprland.enable =
config.lib.stylix.mkEnableTarget "Hyprland" true;

config.wayland.windowManager.hyprland.settings =
lib.mkIf (config.stylix.enable && config.stylix.targets.hyprland.enable) settings;
config =
lib.mkIf
(config.stylix.enable && config.stylix.targets.hyprland.enable)
{
services.hyprpaper.enable = true;
stylix.targets.hyprpaper.enable = true;
wayland.windowManager.hyprland.settings = settings;
};
}
14 changes: 14 additions & 0 deletions modules/hyprpaper/hm.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{ config, lib, ... }: {
options.stylix.targets.hyprpaper.enable =
config.lib.stylix.mkEnableTarget "Hyprpaper" true;

config =
lib.mkIf
(config.stylix.enable && config.stylix.targets.hyprpaper.enable)
{
services.hyprpaper.settings = {
preload = [ "${config.stylix.image}" ];
wallpaper = [ ",${config.stylix.image}" ];
};
};
}

0 comments on commit f13c946

Please sign in to comment.