Skip to content

Instantly share code, notes, and snippets.

@davidrielo
Created October 10, 2023 11:42
Show Gist options
  • Save davidrielo/c664627f03a80a3201c3fa05267e4a65 to your computer and use it in GitHub Desktop.
Save davidrielo/c664627f03a80a3201c3fa05267e4a65 to your computer and use it in GitHub Desktop.
To change the wallpaper of mac from the shell command
# sh wallpaper.sh <path-to-the-file>
path="$1"
osascript -e 'tell application "Finder" to set desktop picture to POSIX file "'"$path"'"'
ret=$?
if [ $ret == "0" ]; then
echo "Wallpaper set successfully "
else
echo "Operation failed."
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment