Add hyprpaper

This commit is contained in:
ItsDrike 2024-06-27 22:00:11 +02:00
parent 842b009f84
commit 73c7b503ad
Signed by: ItsDrike
GPG key ID: FA2745890B7048C0
4 changed files with 49 additions and 0 deletions

View file

@ -1,5 +1,6 @@
_: {
imports = [
./dunst.nix
./hyprpaper.nix
];
}

View file

@ -0,0 +1,34 @@
{
lib,
pkgs,
osConfig,
config,
...
}: let
inherit (lib) mkIf getExe;
cfg = osConfig.myOptions.home-manager.services.hyprpaper;
cfgIsWayland = osConfig.myOptions.home-manager.wms.isWayland;
in {
config = mkIf (cfg.enable && cfgIsWayland) {
systemd.user.services.hyprpaper = {
Install.WantedBy = [ "hyprland-session.target" ];
Unit = {
Description = "Hyprpaper (Hyprland wallpaper daemon)";
PartOf = [ "graphical-session.target" ];
After = [ "graphical-session.target" ];
};
Service = {
Type = "simple";
ExecStart = "${getExe pkgs.hyprpaper}";
Restart = "on-failure";
};
};
xdg.configFile."hypr/hyprpaper.conf".text = ''
preload=${cfg.wallpaperPath}
wallpaper=,${cfg.wallpaperPath} # same wallpaper on all monitors
ipc=off
'';
};
}