#!/usr/bin/env zsh cd "$HOME" set -eo pipefail # Privileges and hostnames echo "$USER ALL=(ALL:ALL) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/$USER sudo chmod 0440 /etc/sudoers.d/$USER sudo visudo -c sudo spctl --master-disable sudo scutil --set HostName "macbook" sudo scutil --set LocalHostName "macbook" sudo scutil --set ComputerName "macbook" dscacheutil -flushcache # Install Homebrew /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" # Configure Homebrew path for immediate use eval "$(/opt/homebrew/bin/brew shellenv)" # Install brew formulas and casks brew install fastfetch brew install ncdu brew install --cask iterm2 brew install --cask docker brew install --cask zed brew install --cask discord brew install --cask spotify # Install Oh My Zsh RUNZSH=no /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" # Install Powerline Fonts git clone --depth=1 https://github.com/powerline/fonts.git cd fonts ./install.sh cd .. rm -rf fonts # Install Zsh Plugins git clone --depth=1 https://github.com/marlonrichert/zsh-autocomplete.git "${HOME}/.oh-my-zsh/custom/plugins/zsh-autocomplete" git clone --depth=1 https://github.com/zsh-users/zsh-autosuggestions.git "${HOME}/.oh-my-zsh/custom/plugins/zsh-autosuggestions" git clone --depth=1 https://github.com/zsh-users/zsh-syntax-highlighting.git "${HOME}/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting" # Update .zshrc configuration ZSHRC_FILE="$HOME/.zshrc" OLD_PLUGINS="plugins=(git)" NEW_PLUGINS="plugins=(git sudo copyfile command-not-found docker python zsh-autocomplete zsh-autosuggestions zsh-syntax-highlighting)" sed -i '' "s/${OLD_PLUGINS}/${NEW_PLUGINS}/" "$ZSHRC_FILE" sed -i '' 's/ZSH_THEME="robbyrussell"/ZSH_THEME="agnoster"/' "$ZSHRC_FILE" sed -i '' "s/^# zstyle ':omz:update' mode auto/zstyle ':omz:update' mode auto/" "$ZSHRC_FILE" echo 'export PATH=$PATH:/usr/sbin' >> "$ZSHRC_FILE" # Don't write .DS_Store on USB or network volumes defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true # Display sleep timers on battery and wall power (in minutes) sudo pmset -b displaysleep 5 sudo pmset -c displaysleep 5 # Require password immediately when screen turns off or screensaver starts defaults write com.apple.screensaver askForPassword -int 1 defaults write com.apple.screensaver askForPasswordDelay -int 0 # Continuous key repeat defaults write -g ApplePressAndHoldEnabled -bool false # Key repeat rate (fastest) and delay until repeat (shortest) defaults write -g KeyRepeat -int 2 defaults write -g InitialKeyRepeat -int 15 # Spelling and auto-correction defaults write -g NSAutomaticSpellingCorrectionEnabled -bool false defaults write -g NSAutomaticCapitalizationEnabled -bool false defaults write -g NSAutomaticQuoteSubstitutionEnabled -bool false defaults write -g NSAutomaticDashSubstitutionEnabled -bool false defaults write -g NSAutomaticPeriodSubstitutionEnabled -bool false defaults write -g NSAutomaticTextCompletionEnabled -bool false # Tap to Click defaults write com.apple.AppleMultitouchTrackpad Clicking -bool true defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool true defaults -currentHost write -g com.apple.mouse.tapBehavior -int 1 # Set trackpad click pressure weight (1 = Medium) defaults write com.apple.AppleMultitouchTrackpad FirstClickThreshold -int 1 defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad FirstClickThreshold -int 1 # Disable trackpad force click and haptic feedback defaults -currentHost write -g com.apple.trackpad.forceClick -int 0 defaults write com.apple.AppleMultitouchTrackpad ActuateDetents -int 0 defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad ActuateDetents -int 0 # Three-Finger Drag (text selection) defaults write com.apple.AppleMultitouchTrackpad TrackpadThreeFingerDrag -bool true defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadThreeFingerDrag -bool true defaults -currentHost write -g com.apple.trackpad.threeFingerDragGesture -int 1 # Three-Finger Tap for Look Up defaults write com.apple.AppleMultitouchTrackpad TrackpadThreeFingerTapGesture -int 2 defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadThreeFingerTapGesture -int 2 defaults -currentHost write -g com.apple.trackpad.threeFingerTapGesture -int 2 # Natural scrolling, trackpad zooming, and rotations defaults write -g com.apple.swipescrolldirection -bool true defaults write com.apple.AppleMultitouchTrackpad TrackpadPinch -bool true defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadPinch -bool true defaults write com.apple.AppleMultitouchTrackpad TrackpadRotate -bool true defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadRotate -bool true defaults write com.apple.AppleMultitouchTrackpad TrackpadTwoFingerDoubleTapGesture -bool true defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadTwoFingerDoubleTapGesture -bool true # Swipe between pages with two fingers defaults write -g AppleEnableSwipeNavigateWithScrolls -bool true defaults write -g AppleEnableMouseSwipeNavigateWithScrolls -bool true # Swipe between desktops with four fingers defaults write com.apple.AppleMultitouchTrackpad TrackpadFourFingerHorizSwipeGesture -int 2 defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadFourFingerHorizSwipeGesture -int 2 defaults -currentHost write -g com.apple.trackpad.fourFingerHorizSwipeGesture -int 2 # Mission Control & App Expose with four-finger vertical swipes defaults write com.apple.AppleMultitouchTrackpad TrackpadFourFingerVertSwipeGesture -int 2 defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadFourFingerVertSwipeGesture -int 2 defaults -currentHost write -g com.apple.trackpad.fourFingerVertSwipeGesture -int 2 # Global System Behaviour defaults write -g AppleInterfaceStyle -string "Dark" defaults write -g AppleLanguages -array "en-CY" "el-CY" defaults write -g AppleLocale -string "en_CY" defaults write -g AppleMeasurementUnits -string "Centimeters" defaults write -g AppleMetricUnits -bool true defaults write -g AppleICUForce24HourTime -bool true defaults write -g AppleScrollerPagingBehavior -bool true # Dock defaults write com.apple.dock autohide -bool true defaults write com.apple.dock tilesize -int 60 defaults write com.apple.dock wvous-bl-corner -int 4 defaults write com.apple.dock wvous-bl-modifier -int 0 # Desktop and Window Manager defaults write com.apple.WindowManager EnableStandardClickToShowDesktop -bool false defaults write com.apple.WindowManager StandardHideWidgets -bool true defaults write com.apple.WindowManager StageManagerHideWidgets -bool true # Finder layout and display defaults write com.apple.finder AppleShowAllFiles -bool true defaults write com.apple.finder ShowPathbar -bool true defaults write com.apple.finder ShowStatusBar -bool true defaults write com.apple.finder _FXSortFoldersFirst -bool true defaults write com.apple.finder FXPreferredViewStyle -string "Nlsv" defaults write com.apple.finder NewWindowTarget -string "PfHm" defaults write com.apple.finder NewWindowTargetPath -string "file://${HOME}/" defaults write com.apple.finder FXDefaultSearchScope -string "SCcf" defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool true defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool true defaults write -g AppleShowAllExtensions -bool true # Relaunch services killall Finder killall Dock