From 550375c872e28b636b1d0753a523a26228a9a2f5 Mon Sep 17 00:00:00 2001 From: Louis Date: Tue, 13 Jun 2023 19:17:07 +0200 Subject: [PATCH] feat: :sparkles: Add posibility to add apps to dock --- macos-setup.sh | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/macos-setup.sh b/macos-setup.sh index 9325479..54fef6d 100755 --- a/macos-setup.sh +++ b/macos-setup.sh @@ -26,7 +26,7 @@ fi # Check if homebrew is installed if test ! $(which brew); then echo "Installing homebrew" - ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" + /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" fi # Update homebrew @@ -84,4 +84,25 @@ for cask in ${CASKS[@]}; do fi done +# Ask user if they want to add install apps to dock +echo "Do you want to add apps to dock? (y/n)" +read -r response +if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]; then + # Check if dockutil is installed + if ! brew list dockutil > /dev/null 2>&1; then + echo "Installing dockutil" + brew install dockutil + fi + + echo "Adding apps to dock" + # Add apps to dock + dockutil --no-restart --add "/Applications/Visual Studio Code.app" + dockutil --no-restart --add "/Applications/iTerm.app" + dockutil --no-restart --add "/Applications/1Password 7.app" + dockutil --no-restart --add "/Applications/Notion.app" + dockutil --no-restart --add "/Applications/Discord.app" + dockutil --no-restart --add "/Applications/Arc.app" + killall Dock +fi + echo "Macbook setup complete" \ No newline at end of file