Created
October 10, 2023 11:42
-
-
Save davidrielo/c664627f03a80a3201c3fa05267e4a65 to your computer and use it in GitHub Desktop.
To change the wallpaper of mac from the shell command
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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