Posted on 03-10-2022 03:35 AM
Dear All,
I need a bash script for adding "Favourites Finder Sidebar items" in macOS Monterey or Custom Payload profile.
Please advise.
Thanks!
Raj.
Posted on 03-23-2022 09:40 PM
Dear All,
Please check the script below: It is not working when pushed from Jamf but working using the terminal.
Thoughts?
Thanks!
Raj.
#!/bin/sh
#Finds current username and defines a variable
currentuser=`stat -f "%Su" /dev/console`
#Substituting as user stored in variable to modify plist
#su "$currentuser" -c "<command to run>"
#Add Movies, Music, Pictures, <username>, to Finder Favorites sidebar.
su "$currentuser" -c "mysides add com.apple.LSSharedFileList.FavoriteItems file:///Applications"
su "$currentuser" -c "mysides add com.apple.LSSharedFileList.FavoriteItems file:///Users/$currentuser"
su "$currentuser" -c "mysides add com.apple.LSSharedFileList.FavoriteItems file:///Users/$currentuser/Movies"
su "$currentuser" -c "mysides add com.apple.LSSharedFileList.FavoriteItems file:///Users/$currentuser/Music"
su "$currentuser" -c "mysides add com.apple.LSSharedFileList.FavoriteItems file:///Users/$currentuser/Pictures"
su "$currentuser" -c "mysides add com.apple.LSSharedFileList.FavoriteItems file:///Users/$currentuser/Downloads"
su "$currentuser" -c "mysides add com.apple.LSSharedFileList.FavoriteItems file:///Users/$currentuser/Documents"
#Restarts cfprefsd and Finder
killAll cfprefsd
killAll Finder
echo "Finder Preferences set"
exit 0
Posted on 04-13-2022 12:12 PM
"mysides" is a separate application that can be installed via homebrew; it is not included by default on macOS.
If you distributed mysides first and then ran this script with the complete path to the binary (say /usr/local/bin/mysides), your changes should take effect.
Posted on 04-22-2022 11:36 AM
I can second this. I figured out how to use it, and it works. You can also install it from the "Releases" section on GitHub (Releases · mosen/mysides (github.com)). You may to re-sign the package using your Jamf Pro signing certificate (I had to do this), then deploy the signed package to your mcabooks. After it is deployed, you can create a script to run the mysides commands that you want.
Posted on 04-11-2022 06:20 PM
Hello Raj,
I am also trying to figure this out.I'd like to try and collaborate with this one, if you are still interested. Some questions I have for you...
Does this script require any 3rd party tools, or does it work for you using "vanilla" macOS?
Which macOS version have you tested this on where it works successfully?
Is there any more contextual technical information you can provide on what was required for this script work for you?
Thanks.