Skip to content

Instantly share code, notes, and snippets.

@udezekene
Last active January 1, 2025 16:40
Show Gist options
  • Save udezekene/92ae5db367f1cc772f228717cb23b052 to your computer and use it in GitHub Desktop.
Save udezekene/92ae5db367f1cc772f228717cb23b052 to your computer and use it in GitHub Desktop.
Setup script
# Get sudo
#sudo -v
# Install brew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Enable brew
(
echo
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"'
) >>/Users/udezekene/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
# Install packages and casks with brew
echo "Installing programs with homebrew"
brew update
brew upgrade
brew install --cask 1password 1password-cli arc google-chrome elgato-camera-hub figma imageoptim raycast visual-studio-code cleanshot iTerm2 Spotify mullvadvpn fontbase sip
# installing dependencies
brew install eza wget dockutil gh git zsh-autosuggestions zsh-syntax-highlighting
# create LaunchAgents dir
mkdir -p ~/Library/LaunchAgents
# enable automatic updates every 12 hours
echo "Enabling autoupdate for homebrew packages..."
brew tap homebrew/autoupdate
brew autoupdate start 43200 --upgrade
# Set up dock icons
echo "Setting up dock"
dockutil --remove all --no-restart
dockutil --add "/Applications/Arc.app" --no-restart
dockutil --add "/Applications/Spotify.app" --no-restart
dockutil --add "/Applications/Visual Studio Code.app" --no-restart
dockutil --add "/System/Applications/Utilities/iTerm2.app" --no-restart
dockutil --add "/System/Applications/Messages.app" --no-restart
dockutil --add "/System/Applications/Notes.app" --no-restart
dockutil --add "/System/Applications/System Settings.app" --no-restart
# Folders to add to the dock
dockutil --add '/Applications' --view grid --display folder --no-restart
dockutil --add '~/Documents' --view list --display folder --no-restart
dockutil --add '~/Downloads' --view list --display folder
# xcode command line tools
xcode-select --install
#eval "$(op signin)" Remove the 1password git signing setup.
# git config
echo "Setting up git"
git config --global user.name "Kene Udeze"
git config --global user.email "[email protected]"
git config --global core.editor "code --wait"
git config --global push.default upstream
# commit signing with 1password
# git config --global user.signingkey "$(op item get "GitHub Sign Key" --fields "Public Key" --account RXTVLR6HMRES3CGS7G3WHSUPOQ)"
# git config --global gpg.format "ssh"
# #git config --global gpg.ssh.program "/Applications/1Password.app/Contents/MacOS/op-ssh-sign"
# git config --global commit.gpgsign true
# git aliases
git config --global alias.undo "reset --soft HEAD^"
# set up ssh keys DONT SETUP SSH KEYS YET
# echo "Setting up SSH keys"
# mkdir -p ~/.ssh
# op read "op://Private/GitHub Sign Key /private key" -o ~/.ssh/id_ed25519
# chmod 600 ~/.ssh/id_ed25519
# ssh-add ~/.ssh/id_ed25519
echo "Updating macOS settings"
# Change Arc icon
defaults write company.thebrowser.Browser currentAppIconName candy
# Disable annoying backswipe in Arc
#defaults write company.thebrowser.Browser AppleEnableMouseSwipeNavigateWithScrolls -bool false
#defaults write company.thebrowser.Browser AppleEnableSwipeNavigateWithScrolls -bool false
# Avoid the creation of .DS_Store files on network volumes or USB drives
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true
# Enable three-finger drag
# defaults write com.apple.AppleMultitouchTrackpad DragLock -bool false
# defaults write com.apple.AppleMultitouchTrackpad Dragging -bool false
# defaults write com.apple.AppleMultitouchTrackpad TrackpadThreeFingerDrag -bool true
# Dock tweaks
#defaults write com.apple.dock orientation -string left # Move dock to left side of screen
defaults write com.apple.dock show-recents -bool FALSE # Disable "Show recent applications in dock"
#defaults write com.apple.Dock showhidden -bool TRUE # Show hidden applications as translucent
#killall Dock
# Finder tweaks
defaults write NSGlobalDomain AppleShowAllExtensions -bool true # Show all filename extensions
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false # Disable warning when changing a file extension
defaults write com.apple.finder FXPreferredViewStyle Clmv # Use column view
defaults write com.apple.finder AppleShowAllFiles -bool true # Show hidden files
defaults write com.apple.finder ShowPathbar -bool true # Show path bar
defaults write com.apple.finder ShowStatusBar -bool true # Show status bar
defaults write com.apple.Preview ApplePersistenceIgnoreState YES # Don't open previous previewed files (e.g. PDFs) when opening a new one
defaults write com.apple.screencapture type jpg # Save screenshots as jpg not png
killall Finder
# Disable "the disk was not ejected properly" messages
defaults write /Library/Preferences/SystemConfiguration/com.apple.DiskArbitration.diskarbitrationd.plist DADisableEjectNotification -bool YES
killall diskarbitrationd
echo "Starting services"
open "/Applications/CleanShot\ X.app"
open "/Applications/Sip.app"
open "/Applications/Mullvad\ VPN.app"
echo "Removing config programs"
brew remove dockutil
# zsh aliases
# echo "alias c='open \$1 -a \"Visual Studio Code\"'" >>~/.zshrc
# cd ~
# brew install jandedobbeleer/oh-my-posh/oh-my-posh
# echo "Remember to install oh-my-posh and the themes"
# # set oh-my-posh theme
# eval "$(oh-my-posh --init --shell zsh --config ~/.poshthemes/alien.omp.json)"
# Path to your oh-my-zsh installation.
# export ZSH="$HOME/.oh-my-zsh"
# add ssh-agent plugin
# sed -i -e 's/plugins=(git)/plugins=(git ssh-agent)/' ~/.zshrc
# oh-my-zsh
# chsh -s $(which zsh)
# finish
source ~/.zshrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment