#!/bin/bash
#
# Force wallpaper to switch immediately

set -e

if [ $(uname -a | grep -ci Darwin) != 1 ]; then
  echo "Sorry, this script only works on macOS"
  exit 1
fi

exec osascript <<EOF
tell application "System Events"
    tell current desktop
        set initInterval to get change interval
        set change interval to -1
        set change interval to initInterval
     end tell
end tell
EOF
