From 8f71fac972b4fe5a98459148d9b33d1748deaa7f Mon Sep 17 00:00:00 2001 From: Ryan Schanzenbacher Date: Mon, 6 Jul 2026 22:50:11 -0400 Subject: initial simple-bar config --- modules/darwin/random-wallpaper.nix | 45 ------------------------------------- 1 file changed, 45 deletions(-) delete mode 100644 modules/darwin/random-wallpaper.nix (limited to 'modules/darwin') diff --git a/modules/darwin/random-wallpaper.nix b/modules/darwin/random-wallpaper.nix deleted file mode 100644 index 793096f..0000000 --- a/modules/darwin/random-wallpaper.nix +++ /dev/null @@ -1,45 +0,0 @@ -{ config, lib, pkgs, ... }: -let - cfg = config.local.randomWallpaper; - script = pkgs.writeShellApplication { - name = "set-random-wallpaper"; - runtimeInputs = [ pkgs.coreutils pkgs.findutils ]; - text = '' - set -euo pipefail - img=$(find "${cfg.directory}" \ - -type f \( -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.png' \) \ - | shuf -n1) - [ -n "$img" ] || exit 0 - #/usr/bin/osascript -e "tell application \"System Events\" to tell every desktop to set picture to \"$img\"" - #desktoppr "$img" - URL="file://$img" - PLIST="${config.users.users.${config.system.primaryUser}.home}/Library/Application Support/com.apple.wallpaper/Store/Index.plist" - /usr/libexec/PlistBuddy -c "set AllSpacesAndDisplays:Desktop:Content:Choices:0:Files:0:relative $URL" "$PLIST" - /usr/bin/killall WallpaperAgent 2>/dev/null || true - ''; - }; -in -{ - options.local.randomWallpaper = { - enable = lib.mkEnableOption "Random Rotating Wallpaper"; - directory = lib.mkOption { - type = lib.types.str; - description = "Folder containing images"; - }; - interval = lib.mkOption { - type = lib.types.int; - default = 1800; - description = "Seconds between wallpaper changes"; - }; - }; - - config = lib.mkIf cfg.enable { - launchd.user.agents.random-wallpaper.serviceConfig = { - Label = "org.rschanz.wallpaperDaemon"; - ProgramArguments = [ "${script}/bin/set-random-wallpaper" ]; - StartInterval = cfg.interval; - RunAtLoad = true; - ProcessType = "Background"; - }; - }; -} -- cgit v1.3