From 06f4083f0d8f521dfde6e1961de8354b6df4a92e Mon Sep 17 00:00:00 2001 From: Ryan Schanzenbacher Date: Sun, 21 Jun 2026 23:59:30 -0400 Subject: another new way for wallpapers and lock screen keyboard shortcut --- modules/darwin/random-wallpaper.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'modules/darwin/random-wallpaper.nix') diff --git a/modules/darwin/random-wallpaper.nix b/modules/darwin/random-wallpaper.nix index 75248b7..793096f 100644 --- a/modules/darwin/random-wallpaper.nix +++ b/modules/darwin/random-wallpaper.nix @@ -3,7 +3,7 @@ let cfg = config.local.randomWallpaper; script = pkgs.writeShellApplication { name = "set-random-wallpaper"; - runtimeInputs = [ pkgs.coreutils pkgs.findutils pkgs.desktoppr]; + runtimeInputs = [ pkgs.coreutils pkgs.findutils ]; text = '' set -euo pipefail img=$(find "${cfg.directory}" \ @@ -11,7 +11,11 @@ let | 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" + #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 -- cgit v1.3