{
  lib,
  config,
  ...
}: let
  cfg = config.mods.theme.slideshow;
in {
  options.mods.theme.slideshow = {
    enable = lib.mkEnableOption "enables slideshow wallpaper";
    folder = lib.mkOption {
      default = "%h/misc/pictures/wallpapers";
      description = "slideshow wallpaper folder";
    };
  };

  config = lib.mkIf cfg.enable {
    services.random-background = lib.mkIf cfg.enable {
      enable = true;
      imageDirectory = cfg.folder;
      enableXinerama = true;
      interval = "1s";
    };
  };
}
