Il percorso e la funzionalità sono sembrati cambiare. Ecco un link e cita tutorial per farlo. Sfortunatamente, appare molto più fastidioso in High Sierra +.
If you are using High Sierra (or later), the ScreenSaverEngine.app has
been moved to a different location. Use the code below instead of the
one above.
/System/Library/CoreServices/ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine -background &
The problem with running just that line of code is that if you close
the Terminal window — or if your Mac goes to sleep — the screen saver
closes and your wallpaper goes back to whatever it was by default. To
handle this, we need to go a bit deeper.
To detect when the Mac sleeps and wakes up, we need a small piece of
software called “Sleepwatcher.” You can download it here. Just open
the file and your Mac will extract the downloaded file (sometimes it
might have to be extracted twice). After extracting, you’ll get a
“sleepwatcher_2.2” folder. Just move this folder to Desktop and run
the following lines of code in the Terminal.
sudo mkdir -p /usr/local/sbin /usr/local/share/man/man8
You might need to enter your password after pasting this line. Next,
run:
sudo cp ~/Desktop/sleepwatcher_2.2/sleepwatcher /usr/local/sbin
Then run:
sudo cp ~/Desktop/sleepwatcher_2.2/sleepwatcher.8 /usr/local/share/man/man8
Awesome! You have successfully installed Sleepwatcher. Now let’s add
the lines of code needed to make Sleepwatcher run the screen saver
when your Mac wakes up, and kill the screen saver when your Mac goes
to sleep.
Sleepwatcher searches for and runs two files, .sleep
when the Mac
sleeps, and .wakeup
when the Mac wakes up. We just need to create
these 2 files in the user’s Home Directory.
In the Terminal, type nano ~/.wakeup
then paste the below code.
#!/bin/bash
osascript -e 'do shell script "/System/Library/Frameworks/ScreenSaver.framework/Resources/ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine -background & EOF"'
Now press Control + X to exit. When it asks if you want to save the
file, press Y and then press the enter key to confirm the file name.
This will create the .wakeup file. Now to create the .sleep
file.
Just like above, type nano ~/.sleep
and paste the below code.
#!/bin/bash
osascript -e 'do shell script "kill 'ps -ax | grep [S]creenSaver | cut -c1-6' EOF"'
Again, press Control + X to exit, Y to save, and then the enter key to
confirm the file name. Now the .sleep
file will be created.
In Terminal, run the below line of code.
chmod 700 ~/.sleep ~/.wakeup
It changes the permissions for the newly created files so that it can
be run by Sleepwatcher.
Now that you’ve created the scripts, you just need to add Sleepwatcher
to launchd
so that it can start when the system starts, then
continue to run in the background. Paste the following code code into
your Terminal.
cp ~/Desktop/sleepwatcher_2.2/config/de.bernhard-baehr.sleepwatcher-20compatibility-localuser.plist ~/Library/LaunchAgents
This will copy the Sleepwatcher property list file so that it can be
added to launchd
. Now just paste the code below into Terminal to add
Sleepwatcher to launchd
.
launchctl load ~/Library/LaunchAgents/de.bernhard-baehr.sleepwatcher-20compatibility-localuser.plist
Awesome! You can now restart your Mac and the launchd will run the
Sleepwatcher scripts at the startup. Just put your Mac to sleep and
wake it up. Then you’ll be welcomed with a beautiful wallpaper.