kcrawford / dockutil

command line tool for managing dock items
http://patternbuffer.wordpress.com
Apache License 2.0
1.37k stars 131 forks source link

Best practice for adding a list of items to dock? #92

Closed bryand23 closed 4 years ago

bryand23 commented 4 years ago

I've got a bash script with an array of application paths that I'm using to create standardized docks, and I've found that you can't simply iterate through a list adding each item to the dock. It takes a few seconds for the dock to refresh and somewhere in the process it ends up skipping over several items in the list.

I'm working around this at the moment by adding sleep 5 but I was wondering if there was a better way to accomplish this? Or perhaps a way to pass an array to dockutil to add multiple items to the dock at once?

erikng commented 4 years ago

I do it with a python wrapper

It's worked pretty well for me for several years now.

https://github.com/erikng/installapplicationsdemo/blob/master/installapplications/scripts/user/dockutil.py

Thanks, Erik Gomez


From: bryand23 notifications@github.com Sent: Monday, March 30, 2020 2:20:35 PM To: kcrawford/dockutil dockutil@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: [kcrawford/dockutil] Best practice for adding a list of items to dock? (#92)

I've got a bash script with an array of application paths that I'm using to create standardized docks, and I've found that you can't simply iterate through a list adding each item to the dock. It takes a few seconds for the dock to refresh and somewhere in the process it ends up skipping over several items in the list.

I'm working around this at the moment by adding sleep 3 but I was wondering if there was a better way to accomplish this? Or perhaps a way to pass an array to dockutil to add multiple items to the dock at once?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/kcrawford/dockutil/issues/92, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABLL6GCHDQRPW2IIKWYQGC3RKDWIHANCNFSM4LW2VKQQ.

bryand23 commented 4 years ago

Oh, small world @erikng! I was just playing around with your UMAD program the other day :)

It looks like the --no-restart flag is the fix to my issue, if an item is being added to the dock during the restart, it has a pretty good chance of not ending up in the dock.

Thanks!