OneDrive for MacOS Desktop Sync

My wife has a MacBook and likes to use her desktop to organize all of her folders and files. For her graduate school, she needs to share some of these files with computers running Windows 10. The university uses OneDrive to sync files between personal computers and lab computers. 

Syncing the desktop is not default supported behavior on OneDrive for MacOS. Could the user change their workflow to adapt to the tools provided? Sure! Personally, cluttered desktops bother me and the users’ workflow is greatly distressing. I’d love to have a completely clean desktop to admire the background image. However, in this case, I can provide better business value by providing a free and easy technical solution that adapts to the users’ existing workflow than to attempt to train the user for a modified workflow. 

On a Mac, the OneDrive folder must be named “OneDrive” and the application complains if you change the name. I put it in the users home folder at “~/OneDrive”

The steps below work great on MacOS Catalina 10.15.6. I turned off iCloud sync for the Desktop and Documents before making these changes to avoid any conflicts.

  1. Make a desktop folder in the OneDrive folder at ~/OneDrive/Desktop
  2. Open Terminal and move everything from the current desktop to the new folder
    • mv ~/Desktop/* ~/OneDrive/Desktop
  3. Create a symbolic link from the Desktop folder 
    • ln -s ~/OneDrive/Desktop ./Desktop
    • sudo chflags -h schg ./Desktop
  4. Organize the files on the desktop to be arranged similar to how they were before if there was some semblance of organizational structure

Notes: 

I originally used ~/Desktop as described in reference [1]; however, that put a folder shortcut to  “Desktop” on the Desktop. Using ./Desktop, as described in reference [2], actually used my cloud Desktop folder for my Desktop folder and the files were accessible from the desktop. The ./Desktop in reference [2] is superior, hence why it appears in my instructions above. 

References:

  1. https://stackoverflow.com/questions/44834712/how-to-change-the-desktop-folder-from-desktop-local-to-a-different-folder-on
  2. https://stackoverflow.com/questions/44834712/how-to-change-the-desktop-folder-from-desktop-local-to-a-different-folder-on
  3. https://ifyouwillit.com/auto-sync-your-mac-desktop-folder-with-dropbox/