Comments (16)
Looks to be the same as #126
Try running it in the user space
from dockutil.
Looks to be the same as #126
Try running it in the user space
wow fast answer, thanks.
Do you have a sample to avoid try and error for me?
Thanks Armin
from dockutil.
Have a look here,
https://scriptingosx.com/2020/08/running-a-command-as-another-user/
from dockutil.
I tried this with your hint.
it works when I drag the postinstall script in the terminal window. But when I use it from a pkg installer as postinstall it does not work. But a tiny success, docutil does not hangs anymore. But the desired icon was not created inside the dock.
'#!/bin/sh
currentUser=$( echo "show State:/Users/ConsoleUser" | scutil | awk '/Name :/ && ! /loginwindow/ { print $3 }' )
/Users/Shared/Dockutil/dockutil3 --add /Applications/EXPOSÉ\ X\ Client/EXPOSE\ X\ Client.app /Users/$currentUser/Library/Preferences/com.apple.dock.plist
exit 0'
from dockutil.
you need to run the dockutil command as the user. Your example is not doing that, its just getting the current user
from dockutil.
#!/bin/sh
#Define Func
runAsUser() {
currentUser=$( echo "show State:/Users/ConsoleUser" | scutil | awk '/Name :/ { print $3 }' )
uid=$(id -u "$currentUser")
if [ "$currentUser" != "loginwindow" ]; then
launchctl asuser "$uid" sudo -u "$currentUser" "$@"
fi
}
runAsUser /Users/Shared/Dockutil/dockutil3 --add /Applications/EXPOSÉ\ X\ Client/EXPOSE\ X\ Client.app /Users/$currentUser/Library/Preferences/com.apple.dock.plist
exit 0
from dockutil.
Thank
got it working with this script:
https://github.com/mvdbent/setDock/blob/main/setDock-addToDock.sh
looks similar to your one
Armin
from dockutil.
Hello,
i have tried https://github.com/mvdbent/setDock/blob/main/setDock-addToDock.sh
and get this error :
Script exit code: 1
Script result: Dockutil version = 3.0.2no appPath set
Error running script: return code was 1.
i used jamf pro 10.42
i have also tried ths but nothing append except relaod dock
#!/bin/zsh
dockutilbin=$(/usr/bin/which dockutil)
loggedInUser=$( echo "show State:/Users/ConsoleUser" | scutil | awk '/Name :/ && ! /loginwindow/ { print $3 }' )
loggedInUserPlist="/Users/$loggedInUser/Library/Preferences/com.apple.dock.plist"
# Create a clean Dock
dockutil --remove all --no-restart
echo "clean-out the Dock"
# Setup dock, in various examples
dockutil --add /System/Applications/System\ Preferences.app --position 1 --no-restart
dockutil --add /Applications/DisplayLink\ Manager.app --position 2 --no-restart
dockutil --add /Applications/Self\ Service.app --position 3 --no-restart
dockutil --add /System/Applications/Calculator.app --position 4 --no-restart
dockutil --add /Applications/Safari.app --after 'Calculator' --no-restart
dockutil --add /Applications/Google\ Chrome.app --after 'Safari' --no-restart
dockutil --add /Applications/Microsoft\ Teams.app --after 'Google Chrome' --no-restart
dockutil --add /Applications/Microsoft\ Outlook.app --after 'Microsoft Teams' --no-restart
dockutil --add /Applications/Microsoft\ Word.app --after 'Microsoft Outlook' --no-restart
dockutil --add /Applications/Microsoft\ Excel.app --after 'Microsoft Word' --no-restart
dockutil --add /Applications/Microsoft\ PowerPoint.app --after 'Microsoft Excel' --no-restart
dockutil --add /System/Applications/Utilities/Screenshot.app --before 'Self Service' --no-restart
dockutil --add '/Applications' --view grid --display folder --allhomes
dockutil --add '~/Desktop' --view grid --display folder --allhomes
dockutil --add '~/Downloads' --view grid --display folder --allhomes
exit 0
Or how to user DockUtil.swift with jamf please ?
from dockutil.
Use the script from mvdbent that's working, make it easy and simple
from dockutil.
@mvught thanks but it's not working for me.
i create m repo https://github.com/GitSweetDragon/dockutil i don't how to share it
from dockutil.
is this your script? dockutil_corp-settings.sh? in the repo?
from dockutil.
is this your script? dockutil_corp-settings.sh? in the repo?
On this repo "GitSweetDragon" ?
Yes
from dockutil.
Ok man I read your story and I can help you. I have the same environment ass you are, wat you have to do:
-First enroll the machine
-After reboot use Outset to "run once login"
Outset you set de dock setting and other things if you like.
If you have slack you can pb me, and find me under the same name #macadmins channel and share you more.
let me know if this make sense to you and happy to help
from dockutil.
Thanks you
I don't have access to slack macadmin.
I try to register but doesn't work.
from dockutil.
First you need Outset:
https://github.com/chilcote/outset/releases
Make a package in Composer:
if have 3 in here but you can drop your Dock in there.
Deploy this 2 in your deployment!
Thats al you need ;) After enrollment you reboot and then login again and than boom ;)
from dockutil.
And?
from dockutil.
Related Issues (20)
- Check if Application exist before adding to the dock HOT 1
- dockutil 3.0.0 build issue HOT 8
- Add CI pipeline
- Launch under sudo issue HOT 2
- 3.0.2 Dockutil hangs when run as sudo HOT 9
- Not working on macOS 12.3 - need to upgrade Homebrew version from 2 to 3 HOT 11
- Seems to work on macOS Catalina 10.15.7 too? HOT 3
- Dockutils does not work with MacOS Monterrey 12.3 HOT 3
- M1 macOS12.3 dockutil 3 does not work from postinstall script, whats wrong ? HOT 1
- Version 3.0.2 fails with: com.apple.dock.plist does not seem to be a home directory or a dock plist HOT 1
- Dockutil does not restart Dock macOS 11.6.5 Big Sur and 12.6.3 Monterey HOT 3
- Dock Size? HOT 1
- Feature Request: Return Index Number HOT 3
- sudo used when not required resulting in an error for non-admin users HOT 4
- When using with Ansible not all items added to the dock HOT 5
- Dockutil 3.02 issue with Monterey 12.6 and beyond HOT 12
- Package fails to deploy / install via Intune/MDM HOT 1
- user NOT in sudoers after ADE HOT 5
- Safari Shortcut Badge Showing in macOS 13 Ventura HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dockutil.