Add .dock to setup your macOS dock on a new install#866
Add .dock to setup your macOS dock on a new install#866ryanpavlick wants to merge 1 commit intomathiasbynens:mainfrom ryanpavlick:master
Conversation
|
nice, thanks for this, hope it gets merged |
|
This is awesome! Thanks for sharing. |
|
When I install in my macOS, always get errors. Could you help to look at why? ifort: command line warning #10006: ignoring unknown option '-ffree-line-length-none' Something went wrong! ✘ saving the output of this script... |
I'm guessing this command works only for the logged in user, and isn't system wide? |
|
@lisf1979 Maybe u used the wrong bash to execute the script? |
|
@blaues0cke Thanks for your explain. But what do you mean wrong bash? and how to check it or change it? |
|
@rpavlick guessing this requires a dependency? Did a quick search but couldn't find it, please could you let me know? Also, might be worth adding to get installed via |
|
@s10wen Looking at the diff I do not see any dependency required, am I missing something? |
|
Do you realize you are commenting on a pull request for a script that adds
that functionality?
6dd53c0
…On Sun, Oct 20, 2019 at 10:14 AM Dan Stroot ***@***.***> wrote:
Yes, there is clearly a missing dependency. Commands such as this
"add_app_to_dock" are not native to macOS.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#866?email_source=notifications&email_token=AABVI35N6JQMM3J55Q7FYNLQPSGYDA5CNFSM4G3VDN3KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBYO4LI#issuecomment-544271917>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABVI32WIQYHYFA3VXRCN23QPSGYDANCNFSM4G3VDN3A>
.
|
|
Works fantastic on Mojave, Not so much on Catalina. For some reason it is running much more slowly and picking up xcode stuff: add "Xcode.app" to the grep exclusions cleared it up: |
|
@dsroot I think it would be safer and better for performance to remove (or make optional / another command?) the "searching for app path" feature. And instead just declare the absolute path of the apps you want to install: declare -a apps=(
'/System/Applications/Utilities/Terminal.app'
'/System/Applications/Music.app'
'/Applications/Google Chrome.app'
'/Applications/PhpStorm.app'
'/System/Applications/System Preferences.app'
);Note: For those upgrading to Catalina, macOS apps moved to |
|
@kamui545 - I am sure your method is faster and clearer. I think the original author above wanted to make it easier on people and was trying to search for the location of the app you wanted to add for you. I hope someone combines your ideas and the point that macOS Catalina moves the apps to |
Ahhh, I didn't sorry, I missed that, nice. In that case maybe move this section to a config file Just a thought, nice one though, I've been wanting this a while :) |
|
Hey, finally had some time to implement this on my own dotfiles and drop dockutil. Here's the fixed version using function reset_dock {
defaults delete com.apple.dock
killall Dock
}I also added some features, here's a gist: https://gist.github.com/kamui545/c810eccf6281b33a53e094484247f5e8 Feel free to cherry pick for the PR, in case you're interested : ) |
|
This function works much better on Catalina: function add_app_to_dock {
app_name="${1}"
app_path=""
# places to look for an application
declare -a paths=(
"/System/Applications"
"/Applications"
"$HOME/Applications"
);
# check the paths for the app
for path in "${paths[@]}"; do
app=$(ls "${path}" | grep -o "${app_name}.app" | uniq | sort | head -n1)
if [[ -n "${app}" ]]; then
app_path="${path}/${app}"
fi
done
if open -Ra "${app_path}"; then
echo "Dock: $app_path added to the Dock."
defaults write com.apple.dock persistent-apps -array-add "<dict>
<key>tile-data</key>
<dict>
<key>file-data</key>
<dict>
<key>_CFURLString</key>
<string>${app_path}</string>
<key>_CFURLStringType</key>
<integer>0</integer>
</dict>
</dict>
</dict>"
else
echo "ERROR: Application $1 not found." 1>&2
fi
} |
Allows you to easily customize your macOS dock on a new install.
Example: