nixcfg/homeManagerModules/services/randomWallpaper/default.nix

43 lines
1.5 KiB
Nix
Raw Normal View History

{
config,
lib,
pkgs,
...
}: let
wallpaperD = pkgs.writers.writeRuby "randomWallpaperD" {} (builtins.readFile ./script.rb);
in {
config = lib.mkIf config.ar.home.services.randomWallpaper.enable {
services.hyprpaper.enable = lib.mkForce false;
2024-09-17 18:25:23 -04:00
# stylix.targets.hyprpaper.enable = lib.mkForce false;
wayland.windowManager.sway.config.output."*" = lib.mkForce {}; # Dirty. TODO: make more elegant.
systemd.user.services.randomWallpaper = {
Unit = {
After = "graphical-session.target";
2024-09-15 00:32:31 -04:00
BindsTo = lib.optional (config.ar.home.desktop.hyprland.enable) "hyprland-session.target" ++ lib.optional (config.ar.home.desktop.sway.enable) "sway-session.target" ++ lib.optional (config.ar.home.desktop.river.enable) "river-session.target";
Description = "Lightweight swaybg-based random wallpaper daemon.";
PartOf = "graphical-session.target";
};
Service = {
Environment = [
"PATH=${
lib.makeBinPath [
config.wayland.windowManager.hyprland.package
config.wayland.windowManager.sway.package
pkgs.procps
pkgs.swaybg
]
}"
];
ExecStart = "${wallpaperD}";
Restart = "no";
TasksMax = "infinity";
};
2024-09-15 00:32:31 -04:00
Install.WantedBy = lib.optional (config.ar.home.desktop.hyprland.enable) "hyprland-session.target" ++ lib.optional (config.ar.home.desktop.sway.enable) "sway-session.target" ++ lib.optional (config.ar.home.desktop.river.enable) "river-session.target";
};
};
}