Skip to main content

Hello everybody,



does someone have a idea how I can remotely add a folder of pictures to the desktop pictures selection?



Appreciate any ideas/feedback, thank you.

Can you not just drag and drop?


Hi al_platt.



sure I can. But not for 100+ Users 😞.
This is why I like to automate this.


Add the folder and images on an admin machine.
Open up Composer and drag the folder from the finder into the Composer window
Create a pkg and then deploy via policy.



Would that work?


Hi rdwhit.



I think I know how to deploy the files to the clients.
But I dont know how to distribute the setting to add the own picture folder to the syspref menu shown above ...


Ah, sorry, didn't realise you meant that :0)



Composer doesn't seem to grab a plist when you add the folder.



Must write the setting somewhere though....



Seems there's a string in ~/Library/Preferences/com.apple.systempreferences.plist that holds the path to the folder... Can you grab that and push it out to the machines?





Sorry, that's my poor reading comprehension.



This used to be stored in a plist but I think it's writing to the ~/Library/Application Support/Dock/desktoppicture.db. When I add a folder and run a scan I see that getting touched.


@al_platt Interesting, I didnt see that get touched when I ran a scan but it does have the path there. The desktoppicture.db had the following in it.



INSERT INTO "data" VALUES('/Library/Desktop Pictures/test');


test is the folder I added.


Thanks Everybody checking this 🙂.



Following command did not work for me.



defaults write ~/Library/Preferences/com.apple.systempreferences UserFolderPaths "/Library/Desktop Pictures/MLW"


How can I change the value of UserFolderPaths of DSKDesktopPrefPane of com.apple.systempreferences via command line? 🙂.


It's in an array so you can try this:



defaults write ~/Library/Preferences/com.apple.systempreferences DSKDesktopPrefPane '<dict><key>UserFolderPaths</key><array><string>/Library/Desktop Pictures/MLW</string></array></dict>'


This worked for me but I had to restart the computer to see the folder listed in the preferences pane.



I'm still not sure why Apple adds the path to both the com.apple.systempreferences.plist and the desktoppicture.db when adding this through the UI. Weird.


@rdwhitt very odd indeed. Oh well, think we've nailed it between us!


Can somebody get me an updated solution to this? This definitely does not work under Big Sur.


If you put a



killall -hup cfprefsd


After the defaults command you don't have to restart or re-login.



@dan.berlyoung: For me it is working on Big Sur as well but what i saw is that I have to use the full path and in the name of the user in my script to get it working, not only ~
Instead of:



defaults write ~/Library/Preferences/com.apple.systempreferences DSKDesktopPrefPane '<dict><key>UserFolderPaths</key><array><string>/Library/Desktop Pictures/MLW</string></array></dict>'


I had to use:



sudo -u "$currentUser" defaults write /Users/"$currentUser"/Library/Preferences/com.apple.systempreferences DSKDesktopPrefPane '<dict><key>UserFolderPaths</key><array><string>/Library/Desktop Pictures/MLW</string></array></dict>'


This is working for me at least on Catalina, Big Sur (Intel and M1)



BR
Daniel


Hi everyone. Newbie here 🙂 how do you send this command to users?