Posted on 04-06-2016 01:08 PM
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.
Solved! Go to Solution.
Posted on 04-07-2016 11:19 AM
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.
Posted on 04-07-2016 07:17 AM
Can you not just drag and drop?
Posted on 04-07-2016 07:19 AM
Hi al_platt.
sure I can. But not for 100+ Users :-(.
This is why I like to automate this.
Posted on 04-07-2016 07:31 AM
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?
Posted on 04-07-2016 07:43 AM
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 ...
Posted on 04-07-2016 08:20 AM
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?
Posted on 04-07-2016 08:24 AM
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.
Posted on 04-07-2016 08:35 AM
@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.
Posted on 04-07-2016 09:55 AM
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? :-).
Posted on 04-07-2016 11:19 AM
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.
Posted on 04-08-2016 12:36 AM
@rdwhitt very odd indeed. Oh well, think we've nailed it between us!
Posted on 03-03-2021 07:06 AM
Can somebody get me an updated solution to this? This definitely does not work under Big Sur.
Posted on 03-19-2021 10:59 AM
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
Posted on 03-29-2021 06:45 AM
Hi everyone. Newbie here :) how do you send this command to users?