#!/usr/bin/env bash # Close any open System Preferences panes, to prevent them from overriding # settings we’re about to change osascript -e 'tell application "System Preferences" to quit' # Ask for the administrator password upfront sudo -v # Keep-alive: update existing `sudo` time stamp until `.macos` has finished while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null & # Disable boot volume sudo nvram SystemAudioVolume=" " # Set appeariance to dark mode defaults write NSGlobalDomain AppleInterfaceStyle -string "Dark" # Set default accent & highlight color #defaults delete NSGlobalDomain AppleAccentColor #defaults delete NSGlobalDomain AppleHighlightColor # Disable wallpaper tinting defaults write NSGlobalDomain AppleReduceDesktopTinting -bool true # Automatically show scrollbars defaults write NSGlobalDomain AppleShowScrollBars -string "Automatic" # Jump to next page in scroll bar defaults write NSGlobalDomain AppleScrollerPagingBehavior -bool false # Adjust toolbar title rollover delay defaults write NSGlobalDomain NSToolbarTitleViewRolloverDelay -float 0 # Save to disk (not to iCloud) by default defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false # Expand save panel by default defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode2 -bool true # Expand print panel by default defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true defaults write NSGlobalDomain PMPrintingExpandedStateForPrint2 -bool true # Mouse defaults write NSGlobalDomain com.apple.mouse.scaling -float "2.5" # Sets the Bluetooth mouse to two-button mode defaults write com.apple.driver.AppleBluetoothMultitouch.mouse MouseButtonMode TwoButton # Sets the multi-touch mouse to two-button mode defaults write com.apple.AppleMultitouchMouse.plist MouseButtonMode TwoButton # Keyboard # Do nothing when Fn/Globe key pressed defaults write com.apple.HIToolbox AppleFnUsageType -int "0" # use standard Fn keys defaults write NSGlobalDomain com.apple.keyboard.fnState -bool true ############################################################################### # Dock # ############################################################################### # Put the dock on the left on the screen defaults write com.apple.dock "orientation" -string "left" # Autohide the Dock defaults write com.apple.dock "autohide" -bool "true" # Set the Dock opening & closing animation time to 1s defaults write com.apple.dock "autohide-time-modifier" -float "1" #Show active apps only - empties the Dock :) defaults write com.apple.dock "static-only" -bool "true" ############################################################################### # Finder ############################################################################### # Enable Finder Quit menu item defaults write com.apple.finder QuitMenuItem -bool true defaults write com.apple.finder _FXSortFoldersFirst -bool true ############################################################################### # Spotlight # ############################################################################### # Dont create .DS_Store Files On Network Or USB Volumes defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true # Install software # Look for updates sudo softwareupdate -i -a # Install Rosetta sudo softwareupdate --install-rosetta --agree-to-license # install xcode command line tools xcode-select --install # install homebrew NONINTERACTIVE=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" # append Homebrew initialization to .zprofile echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >>${HOME}/.zprofile # immediately evaluate the Homebrew environment settings for the current session eval "$(/opt/homebrew/bin/brew shellenv)" # update and check the installation brew update && brew doctor export HOMEBREW_NO_INSTALL_CLEANUP=1 #install font for startship brew install --cask font-sauce-code-pro-nerd-font #install brew packages brew install git gh glab nvm startship opentofu echo 'eval "$(starship init zsh)"' >> ${HOME}/.zshrc brew install --cask iterm2 mitmproxy 1password arc todoist whatsapp autodesk-fusion spotify loop obsidian drawio bambu-studio # IDE's brew install --cask visual-studio-code android-studio brew install --cask nikitabobko/tap/aerospace # install visual sudio code extenstions code --install-extension gamunu.opentofu # install Mac App Store command-line interface brew install mas # wierguard mas isntall 1451685025 # slack mas install 803453959 # nordlayer mas install 1488888843 # generate github ssh key mkdir -m 700 $HOME/.ssh 2>/dev/null ssh-keygen -t ed25519 -f $HOME/.ssh/gh_id_ed25519 github_ssh_config=" Host github.com AddKeysToAgent yes UseKeychain yes IdentityFile ~/.ssh/gh_id_ed25519 " echo "$github_ssh_config" >> $HOME/.ssh/config ssh-add --apple-use-keychain $HOME/.ssh/gh_id_ed25519 # add the key to github configuration gh auth login --web --hostname github.com --git-protocol ssh --skip-ssh-key -s admin:public_key gh ssh-key add $HOME/.ssh/gh_id_ed25519.pub