diff options
Diffstat (limited to 'modules/darwin/random-wallpaper.nix')
| -rw-r--r-- | modules/darwin/random-wallpaper.nix | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/modules/darwin/random-wallpaper.nix b/modules/darwin/random-wallpaper.nix index 6b17c0f..75248b7 100644 --- a/modules/darwin/random-wallpaper.nix +++ b/modules/darwin/random-wallpaper.nix | |||
| @@ -3,14 +3,15 @@ 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 ]; | 6 | runtimeInputs = [ pkgs.coreutils pkgs.findutils pkgs.desktoppr]; |
| 7 | text = '' | 7 | text = '' |
| 8 | set -euo pipefail | 8 | set -euo pipefail |
| 9 | img=$(find "${cfg.directory}" \ | 9 | img=$(find "${cfg.directory}" \ |
| 10 | -type f \( -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.png' \) \ | 10 | -type f \( -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.png' \) \ |
| 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 | ''; | 15 | ''; |
| 15 | }; | 16 | }; |
| 16 | in | 17 | in |
