2024-08-02 17:58:08 -04:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}: let
|
2024-08-29 21:04:57 -04:00
|
|
|
wallpaperD = pkgs.writers.writeRuby "randomWallpaperD" {} (builtins.readFile ./script.rb);
|
2024-08-02 17:58:08 -04:00
|
|
|
in {
|
|
|
|
config = lib.mkIf config.ar.home.services.randomWallpaper.enable {
|
2024-08-15 15:55:39 -04:00
|
|
|
services.hyprpaper.enable = lib.mkForce false;
|
2024-09-17 18:25:23 -04:00
|
|
|
# stylix.targets.hyprpaper.enable = lib.mkForce false;
|
2024-08-15 15:55:39 -04:00
|
|
|
wayland.windowManager.sway.config.output."*" = lib.mkForce {}; # Dirty. TODO: make more elegant.
|
|
|
|
|
2024-08-02 17:58:08 -04:00
|
|
|
systemd.user.services.randomWallpaper = {
|
|
|
|
Unit = {
|
|
|
|
After = "graphical-session.target";
|
2024-08-12 10:17:21 -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";
|
2024-08-02 17:58:08 -04:00
|
|
|
Description = "Lightweight swaybg-based random wallpaper daemon.";
|
|
|
|
PartOf = "graphical-session.target";
|
|
|
|
};
|
|
|
|
|
|
|
|
Service = {
|
2024-08-29 21:04:57 -04:00
|
|
|
Environment = [
|
|
|
|
"PATH=${
|
|
|
|
lib.makeBinPath [
|
|
|
|
config.wayland.windowManager.hyprland.package
|
|
|
|
config.wayland.windowManager.sway.package
|
|
|
|
pkgs.procps
|
|
|
|
pkgs.swaybg
|
|
|
|
]
|
|
|
|
}"
|
|
|
|
];
|
|
|
|
|
2024-08-02 17:58:08 -04:00
|
|
|
ExecStart = "${wallpaperD}";
|
2024-08-11 23:43:48 -04:00
|
|
|
Restart = "no";
|
2024-08-29 21:04:57 -04:00
|
|
|
TasksMax = "infinity";
|
2024-08-02 17:58:08 -04:00
|
|
|
};
|
|
|
|
|
2024-08-12 10:17:21 -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";
|
2024-08-02 17:58:08 -04:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|