hyprpaper: init (#377)

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]: https://github.com/danth/stylix/issues/408
[2]: 678d0e8959/README.md (L103-L111)

Co-authored-by: NAHO <90870942+trueNAHO@users.noreply.github.com>
This commit is contained in:
Ed Roberts Rayne 2024-06-17 15:30:35 +01:00 committed by GitHub
parent 80e8e1e2f6
commit f13c946181
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 25 additions and 5 deletions

View file

@ -170,11 +170,11 @@
]
},
"locked": {
"lastModified": 1714981474,
"narHash": "sha256-b3/U21CJjCjJKmA9WqUbZGZgCvospO3ArOUTgJugkOY=",
"lastModified": 1715930644,
"narHash": "sha256-W9pyM3/vePxrffHtzlJI6lDS3seANQ+Nqp+i58O46LI=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "6ebe7be2e67be7b9b54d61ce5704f6fb466c536f",
"rev": "e3ad5108f54177e6520535768ddbf1e6af54b59d",
"type": "github"
},
"original": {

View file

@ -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
modules/hyprpaper/hm.nix Normal file
View file

@ -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}" ];
};
};
}