diff options
| author | Ryan Schanzenbacher <ryan@rschanz.org> | 2026-06-21 23:59:30 -0400 |
|---|---|---|
| committer | Ryan Schanzenbacher <ryan@rschanz.org> | 2026-06-21 23:59:30 -0400 |
| commit | 06f4083f0d8f521dfde6e1961de8354b6df4a92e (patch) | |
| tree | 4994f31199ae819295346c3ec2cafc69d2611698 /modules/darwin/random-wallpaper.nix | |
| parent | 1d64a259eb2f377b7b7dc36263eaf33d4a7cf28c (diff) | |
another new way for wallpapers and lock screen keyboard shortcut
Diffstat (limited to 'modules/darwin/random-wallpaper.nix')
| -rw-r--r-- | modules/darwin/random-wallpaper.nix | 8 |
1 files changed, 6 insertions, 2 deletions
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 | |||
| 3 | cfg = config.local.randomWallpaper; | 3 | cfg = config.local.randomWallpaper; |
| 4 | script = pkgs.writeShellApplication { | 4 | script = pkgs.writeShellApplication { |
| 5 | name = "set-random-wallpaper"; | 5 | name = "set-random-wallpaper"; |
| 6 | runtimeInputs = [ pkgs.coreutils pkgs.findutils pkgs.desktoppr]; | 6 | runtimeInputs = [ pkgs.coreutils pkgs.findutils ]; |
| 7 | text = '' | 7 | text = '' |
| 8 | set -euo pipefail | 8 | set -euo pipefail |
| 9 | img=$(find "${cfg.directory}" \ | 9 | img=$(find "${cfg.directory}" \ |
| @@ -11,7 +11,11 @@ let | |||
| 11 | | shuf -n1) | 11 | | shuf -n1) |
| 12 | [ -n "$img" ] || exit 0 | 12 | [ -n "$img" ] || exit 0 |
| 13 | #/usr/bin/osascript -e "tell application \"System Events\" to tell every desktop to set picture to \"$img\"" | 13 | #/usr/bin/osascript -e "tell application \"System Events\" to tell every desktop to set picture to \"$img\"" |
| 14 | desktoppr "$img" | 14 | #desktoppr "$img" |
| 15 | URL="file://$img" | ||
| 16 | PLIST="${config.users.users.${config.system.primaryUser}.home}/Library/Application Support/com.apple.wallpaper/Store/Index.plist" | ||
| 17 | /usr/libexec/PlistBuddy -c "set AllSpacesAndDisplays:Desktop:Content:Choices:0:Files:0:relative $URL" "$PLIST" | ||
| 18 | /usr/bin/killall WallpaperAgent 2>/dev/null || true | ||
| 15 | ''; | 19 | ''; |
| 16 | }; | 20 | }; |
| 17 | in | 21 | in |
