How to set it up?
Launch Terminal, starting our work.
1.
Let’s navigate to our home folder:
cd ~/
2.
Create a folder in iCloud that will contain desktop files:
mkdir "Library/Mobile Documents/com~apple~CloudDocs/Desktop"
3.
Copy there the whole your desktop, keeping all attributes:
cp -p -R -v Desktop/* "~/Library/Mobile Documents/com~apple~CloudDocs/Desktop/"
4.
Rename your original "Desktop" folder in user profile:
sudo mv Desktop Desktop_
You could delete it immediately, but it’s a good idea to keep a backup for a case.
5.
Create a symbolic link to the new desktop location:
sudo ln -s "Library/Mobile Documents/com~apple~CloudDocs/Desktop" Desktop
6.
Relaunch Finder:
killall Finder
Icon order will reset, so it’s a good chance to review what is indeed necessary to keep 🙂
Done!
From now on, when you delete files from desktop, the warning message will be different:
When saving a file or a folder to desktop, you will see its iCloud sync status:
As a bonus, with release of iOS 9 and OS X El Capitan you will be able to access your desktop docs from mobile device or in browser.
For now, it’s possible to check how much storage is used and delete any file, if necessary, from iCloud settings on a phone or tablet:
7.
If it is going smoothly and syncs as it should, you can now delete an old desktop backup:
rm -fr ~/Desktop_
You can now repeat all steps starting with 3 and use the same desktop on any of your computers logged in to the same iCloud account!
I found that after switching to desktop syncing as I suggested in this post, Save for Web and Devices in Photoshop was unable to save files after doing adjustments. In fact, before displaying the file save dialog, Photoshop returned an error message. This was because last save location was ~/Desktop, the folder no longer existed (a symlink instead).
To overcome this, I had to temporarily put back a desktop folder, open the Save for Web and Devices, choose any other folder to save file, and then restore the symlink:
1.
rm ~/Desktop
2.
mkdir ~/Desktop
3.
Open Save for Web and Devices in Photoshop.
4.
Save file to whatever folder outside Desktop.
5.
rmdir ~/Desktop
6.
ln -s ~/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop ~/Desktop