Giter Club home page Giter Club logo

Comments (16)

Lotusshaney avatar Lotusshaney commented on July 28, 2024

Looks to be the same as #126

Try running it in the user space

from dockutil.

ArminDeeg avatar ArminDeeg commented on July 28, 2024

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.

Lotusshaney avatar Lotusshaney commented on July 28, 2024

Have a look here,

https://scriptingosx.com/2020/08/running-a-command-as-another-user/

from dockutil.

ArminDeeg avatar ArminDeeg commented on July 28, 2024

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.

Lotusshaney avatar Lotusshaney commented on July 28, 2024

you need to run the dockutil command as the user. Your example is not doing that, its just getting the current user

from dockutil.

Lotusshaney avatar Lotusshaney commented on July 28, 2024
#!/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.

ArminDeeg avatar ArminDeeg commented on July 28, 2024

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.

GitSweetDragon avatar GitSweetDragon commented on July 28, 2024

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.

mvught avatar mvught commented on July 28, 2024

Use the script from mvdbent that's working, make it easy and simple 😉

from dockutil.

GitSweetDragon avatar GitSweetDragon commented on July 28, 2024

@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.

mvught avatar mvught commented on July 28, 2024

is this your script? dockutil_corp-settings.sh? in the repo?

from dockutil.

GitSweetDragon avatar GitSweetDragon commented on July 28, 2024

is this your script? dockutil_corp-settings.sh? in the repo?

On this repo "GitSweetDragon" ?
Yes

from dockutil.

mvught avatar mvught commented on July 28, 2024

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.

GitSweetDragon avatar GitSweetDragon commented on July 28, 2024

Thanks you ☺️.
I don't have access to slack macadmin.
I try to register but doesn't work.

from dockutil.

mvught avatar mvught commented on July 28, 2024

First you need Outset:
https://github.com/chilcote/outset/releases
Make a package in Composer:
image
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.

mvught avatar mvught commented on July 28, 2024

And?

from dockutil.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.