Skip to main content
Question

Dock Items

  • June 15, 2016
  • 44 replies
  • 137 views

Show first post

44 replies

Forum|alt.badge.img+14
  • Contributor
  • June 24, 2016

A couple of ideas...

  1. Try moving your sleep 15 up before you set your variables. Sounds like there are some odd timing things going on, and the variables are getting set incorrectly, so maybe worth a shot.
  2. Try this method of setting the loggedInUser:
loggedInUser=`python -c 'from SystemConfiguration import SCDynamicStoreCopyConsoleUser; import sys; username = (SCDynamicStoreCopyConsoleUser(None, None, None) or [None])[0]; username = [username,""][username in [u"loginwindow", None, u""]]; sys.stdout.write(username + "
");'`
loggedInUserHome="/Users/$loggedInUser"

I've been using that method for a while successfully, see here: obligatory Der Flounder or MacMule link found in all good JAMF Nation threads


Forum|alt.badge.img+20
  • Contributor
  • June 24, 2016

@stevewood I am using dockutil version 2.0.3 what version are you using ?

I was able to get a dockutil2_0_3.pkg from https://github.com/kcrawford/dockutil

i chose 'clone or download' and got the zip, unzipped it, and somehow was able to get the .pkg out of it. I use that .pkg to install on computers.

I can't seem to replicate how i got the .pkg out of the .zip

Version 2.0.3 notes says ; Wait for dock to be setup by Apple before modifying (useful for first login scripts). My script has a 15 second sleep before the --remove all


stevewood
Forum|alt.badge.img+38
  • Hall of Fame
  • June 24, 2016

@tcandela 2.0.2 here, but I seriously doubt that is the difference. I'll see if I can scratch some time to try that out.


Forum|alt.badge.img+20
  • Contributor
  • June 24, 2016

@stevewood not sure how i was able to get the 2_0_3.pkg out of it but I did. I cannot seem to duplicate whatever i did.

I'll try 2.0.2

i got if from here https://jamfnation.jamfsoftware.com/viewProduct.html?id=203&view=info


Forum|alt.badge.img+10
  • New Contributor
  • June 24, 2016

There are releases that are pre pkg'd.

Release page


stevewood
Forum|alt.badge.img+38
  • Hall of Fame
  • June 24, 2016

@tcandela it is just a Python script, so creating the PKG yourself wouldn't be too difficult. Just save it to your hard drive and then use Packages or Composer or whatever packaging method you want, to create a PKG file of the Python script and then deploy that.

As far as getting 2.0.2, the only way would be for someone to get you a copy, I believe. If you want to send me an email (swood at integer dot com) I can send the 2.0.2 version to you. I don't want to post it here.


Forum|alt.badge.img+20
  • Contributor
  • June 24, 2016

@stevewood i got 2.0.2 dragged it from /usr/local/bin and dragged it into composer and did a build pkg.

I am going to deploy 2.0.2 on a test computer and see if it reacts different than 2.0.3 with those 3 dock items that will not go away for me.

@millersc i don't see a prepackage of 2.0.2


Forum|alt.badge.img+20
  • Contributor
  • June 24, 2016

@Josh.Smith I originally had sleep 15 before the variables, I had the same results. I am gonna try dockutil version 2.0.2


apizz
Forum|alt.badge.img+15
  • Honored Contributor
  • June 24, 2016

@tcandela Check your bash variables. You have the UserPlist variable lines hashed out which directly point to the Dock plist (I assume from previous attempts so you can test other things), which is correct.

But then you use loggedInUserHome which only defines your user's user folder, not the full path to the user's Dock PLIST you want to change.

It seems to me that using $3 to get the loggedin user is your problem and on top of that your $loggedinUserHome is just that, not the full path to the Dock PLIST.


Forum|alt.badge.img+20
  • Contributor
  • June 25, 2016

@aporlebeke i've tried both ways, with the $loggedInUserHome and the $UserPlist, i get the same results

@stevewood says creating a variable to just the home folder will suffice. I've tried both ways anyways and still get the same results.

thats why you see so many # commenting out lines

I am going to test out dockutil 2.0.2 currently this is happening with 2.0.3


Forum|alt.badge.img+6
  • Contributor
  • August 16, 2016

tcandela,
I am having the same issue. Did you resolve this? Doesn't matter which way i grab the user/home varible. This isn't happening on my laptops though. Only the desktops. The only difference between the two is mobile account vs. just force local home.


Forum|alt.badge.img+20
  • Contributor
  • August 16, 2016

@TexasITAdmin no resolution so far. I still have the same three dock items appear at the end. I've tried dockutil 2.0.2 and 2.0.3 and get the same results. Version 2.0.4 is out but it looks like the changes will not make a difference.

better than nothing


Forum|alt.badge.img+8
  • Valued Contributor
  • December 20, 2016

@aporlebeke. I'm new to Casper and DockUtil.

I'm trying to create a customized dock for our Public Lab Users. I borrowed your script and made a few edits for our setup. Thanks for sharing, it really helped me out a lot, and works as advertised.

The one thing I'm having a hard time with is the delay in which the customized dock builds after a user logs in. I have commented out the 'sleep 15' and 'sleep 20', but still have a 15 second delay for dockutil to build everything. This delay doesn't work in a lab situation. I need the customized dock to build immediately after the log in process. What can I do to speed this up even more?


apizz
Forum|alt.badge.img+15
  • Honored Contributor
  • December 20, 2016

@ctarbox We have a similar situation as well with dockutil. There's a number of things that happen when a user logs in to a computer for the first time. From my experience, it just takes a bit of time for the computer to get around to running dockutil. It's faster on computers with SSDs.

Are you using a LaunchAgent to trigger your dockutil script, or something like outset?


Forum|alt.badge.img+8
  • Valued Contributor
  • December 20, 2016

@aporlebeke. In many desktop situations the delay would not be a problem. In a lab situation, the user will not wait (or even be aware that this is happening in the background). I really need the dock to be ready to go as soon as that desktop builds.

Most of my lab machines are now 4+ years. We will be putting out our first series of SSD iMacs next month. It will be fun to see just how much faster these are and if this will make my situation now moot.

I am using the tools the JSS supplies. A combination of a script and Policy that is triggered at login.

I went with DockUtil because it has a great referrals from this group. I've read where other JAMF users are using DockMaster. I haven't looked into this tool yet, but may if anyone can confirm that it handles the building of a customized dock better.


apizz
Forum|alt.badge.img+15
  • Honored Contributor
  • December 20, 2016

@ctarbox When I was first testing dockutil I went the way of a login policy through the JSS. But in that and other experiences, as well as those in some other threads here, that login policies via the JSS can be inconsistent. Example thread

Because of those experiences, when we implemented dockutil this past summer we did so in conjunction with outset, which allowed us to have our dockutil script stored locally on our machines and run at login (we also have other scripts that get run on machine startup and login as well) without needing the JSS at all.

Not saying you have to do this, but something you might consider trying to get a speed comparison.


Forum|alt.badge.img+8
  • Valued Contributor
  • December 20, 2016

@aporlebeke. Thanks for the suggestion. I will look into outset.


Forum|alt.badge.img+13
  • Valued Contributor
  • December 21, 2016

Jeez!
Why not just edit the server.xml, then you can add the dock items via 'dock items' in the suite?

Easier and it just works...

:-(


Forum|alt.badge.img+18
  • Honored Contributor
  • August 30, 2017

Just a fyi: dockfixup is now manageable in 10.12+ using a custom config profile: https://medium.com/@opragel/how-to-customize-stop-dockfixup-on-macos-f349cd3c7b15