diff options
| author | Ryan Schanzenbacher <ryan@rschanz.org> | 2026-07-11 22:14:43 -0400 |
|---|---|---|
| committer | Ryan Schanzenbacher <ryan@rschanz.org> | 2026-07-11 22:14:43 -0400 |
| commit | d2b62c9d6f30a0ea88b2a235cde120cd10ba332b (patch) | |
| tree | f373003e64c3ec4593d7ae4ffac72de52767aa70 /modules/darwin/random-wallpaper/default.nix | |
| parent | 27117202739f092d837af2752e4b9801c47b8ddb (diff) | |
Sketchybar now, got tired of the battery issue
Diffstat (limited to 'modules/darwin/random-wallpaper/default.nix')
| -rw-r--r-- | modules/darwin/random-wallpaper/default.nix | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/modules/darwin/random-wallpaper/default.nix b/modules/darwin/random-wallpaper/default.nix new file mode 100644 index 0000000..b20ce88 --- /dev/null +++ b/modules/darwin/random-wallpaper/default.nix | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | { config, lib, pkgs, ... }: | ||
| 2 | let | ||
| 3 | cfg = config.local.randomWallpaper; | ||
| 4 | wallpaper-agent-src = ./wallpaper-daemon.swift; | ||
| 5 | in | ||
| 6 | { | ||
| 7 | options.local.randomWallpaper = { | ||
| 8 | enable = lib.mkEnableOption "Random Rotating Wallpaper"; | ||
| 9 | directory = lib.mkOption { | ||
| 10 | type = lib.types.str; | ||
| 11 | description = "Folder containing images"; | ||
| 12 | }; | ||
| 13 | interval = lib.mkOption { | ||
| 14 | type = lib.types.int; | ||
| 15 | default = 1800; | ||
| 16 | description = "Seconds between wallpaper changes"; | ||
| 17 | }; | ||
| 18 | }; | ||
| 19 | |||
| 20 | config = lib.mkIf cfg.enable { | ||
| 21 | launchd.user.agents.random-wallpaper.serviceConfig = { | ||
| 22 | Label = "org.rschanz.wallpaperDaemon"; | ||
| 23 | ProgramArguments = [ "/usr/bin/swift" "${wallpaper-agent-src}" "${cfg.directory}" "${builtins.toString cfg.interval}" ]; | ||
| 24 | RunAtLoad = true; | ||
| 25 | KeepAlive = true; | ||
| 26 | ProcessType = "Background"; | ||
| 27 | }; | ||
| 28 | }; | ||
| 29 | } | ||
