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
'';
};
}

View file

@ -217,6 +217,12 @@
services = {
dunst.enable = true;
hyprpaper = {
enable = true;
# This file intentionally lacks a file extension, it should be a symlink
# to whatever file you wish to actually be your wallpaper
wallpaperPath = "/data/Data/Media/Pictures/Wallpapers/active";
};
};
};
};

View file

@ -4,6 +4,14 @@ in
{
options.myOptions.home-manager.services = {
dunst.enable = mkEnableOption "Dunst (lightweight notification daemon)";
hyprpaper = {
enable = mkEnableOption "Hyprpaper (Hyprland wallpaper daemon)";
wallpaperPath = mkOption {
type = types.path;
default = null;
description = "Path to the wallpaper of your choosing";
};
};
};
}