Copy Desktop folder and preserve layout How can I copy the Desktop folder from machine A to machine B and preserve the current icon layout?
I want to replicate the Desktop contents and layout in both machines. I mean the actual Desktop, not a Finder window when opened to ~/Desktop.
I tried copying the ~/Desktop/.DS_Store from A to B but it did not work.
I also tried to create a tar file with ~/Desktop in A and the open the tar file in B, but it did not work: the layout wasn't replicated.
I can now confirm that the layout of files and or folders that are within the ~/Desktop folder and show on the Desktop are indeed stored in the ~/Desktop/.DS_Store file.
That said, the layout is also controlled by the View Options for the Desktop and the settings for both systems need to match. In other words, assuming Sort By it set to None on the source computer, it is also set to None on the destination computer.
Copy the source files and or folders to the Desktop of the destination computer.
After copying the source files and or folders to the Desktop of the destination computer, then in Terminal, on the destination computer, run the following compound command:
cp /path/to/copied/.DS_Store ~/Desktop; killall Finder

You should now see the same layout as on the source computer.