#!/usr/bin/env bash sudo -v while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null & if ! command -v brew &> /dev/null; then echo "Installing Homebrew..." /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" if [[ $(uname -m) == "arm64" ]]; then eval "$(/opt/homebrew/bin/brew shellenv)" else eval "$(/usr/local/bin/brew shellenv)" fi fi DOTFILES_DIR="$HOME/dotfiles" if [ ! -d "$DOTFILES_DIR" ]; then echo "Cloning dotfiles..." git clone https://git.moomancer.xyz/DarthMooMancer/dotfiles.git "$DOTFILES_DIR" else echo "Updating dotfiles" git -C "$DOTFILES_DIR" pull fi cd "$DOTFILES_DIR" brew bundle --file=brew/.Brewfile stow -v -t "$HOME" . cd ~/ if ! grep -q "pam_tid.so" /etc/pam.d/sudo; then echo "Enabling Touch ID for sudo..." sudo sed -i '' '2i\ auth sufficient pam_tid.so ' /etc/pam.d/sudo fi sudo nvram StartupMute=%01 sudo defaults write /Library/Preferences/com.apple.loginwindow showInputMenu -bool true defaults write NSGlobalDomain AppleFontSmoothing -int 1 defaults write com.apple.LaunchServices LSQuarantine -bool false defaults write com.apple.dock single-app -bool true defaults write com.apple.dock autohide -bool true defaults write com.apple.dock autohide-delay -float 0 defaults write com.apple.dock autohide-time-modifier -float 0.2 defaults write com.apple.dock show-recents -bool false defaults write com.apple.dock expose-animation-duration -float 0.1 defaults write com.apple.appstore WebKitDeveloperExtras -bool true defaults write com.apple.appstore ShowDebugMenu -bool true defaults write NSGlobalDomain KeyRepeat -int 2 defaults write NSGlobalDomain InitialKeyRepeat -int 15 defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode2 -bool true defaults write NSGlobalDomain AppleShowAllExtensions -bool true defaults write NSGlobalDomain com.apple.swipescrolldirection -bool false defaults write com.apple.finder ShowPathbar -bool true defaults write com.apple.finder _FXSortFoldersFirst -bool true defaults write com.apple.SoftwareUpdate AutomaticCheckEnabled -bool true defaults write com.apple.SoftwareUpdate ScheduleFrequency -int 1 defaults write com.apple.SoftwareUpdate AutomaticDownload -int 1 defaults write com.apple.SoftwareUpdate CriticalUpdateInstall -int 1 defaults write com.apple.SoftwareUpdate ConfigDataInstall -int 1 defaults write com.apple.commerce AutoUpdate -bool true defaults write com.apple.commerce AutoUpdateRestartRequired -bool true defaults write com.apple.screencapture location -string "${HOME}/Desktop" defaults write com.apple.screencapture type -string "png" defaults write com.apple.screencapture disable-shadow -bool true defaults write com.apple.screensaver askForPassword -int 1 defaults write com.apple.screensaver askForPasswordDelay -int 0 defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)" -int 40 defaults write com.apple.CrashReporter DialogType none defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true defaults write com.apple.Safari HomePage -string "about:blank" defaults write com.apple.Safari AutoPlayPolicy -int 2 defaults write com.apple.Safari UniversalSearchEnabled -bool false defaults write com.apple.Safari SendDoNotTrackHTTPHeader -bool true defaults write com.apple.Safari SuppressSearchSuggestions -bool true defaults write com.apple.Safari WarnAboutFraudulentWebsites -bool true defaults write com.apple.Safari AutoOpenSafeDownloads -bool false defaults write com.apple.Safari ShowFullURLInSmartSearchField -bool true defaults write com.apple.Safari ShowFavoritesBar -bool false defaults write com.apple.Safari ShowSidebarInTopSites -bool false defaults write com.apple.Safari DebugSnapshotsUpdatePolicy -int 2 defaults write com.apple.Safari InstallExtensionUpdatesAutomatically -bool false defaults write com.apple.Safari WebKitJavaScriptCanOpenWindowsAutomatically -bool false defaults write com.apple.Safari WebContinuousSpellCheckingEnabled -bool true defaults write com.apple.Safari WebAutomaticSpellingCorrectionEnabled -bool false defaults write com.apple.Safari AutoFillFromAddressBook -bool true defaults write com.apple.Safari AutoFillPasswords -bool true defaults write com.apple.Safari AutoFillCreditCardData -bool true defaults write com.apple.Safari AutoFillMiscellaneousForms -bool true defaults write com.apple.Safari WebKitJavaScriptCanOpenWindowsAutomatically -bool false defaults write com.apple.Safari WebKitTabToLinksPreferenceKey -bool true defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2TabsToLinks -bool true defaults write com.apple.Safari FindOnPageMatchesWordStartsOnly -bool false defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2BackspaceKeyNavigationEnabled -bool true defaults write com.apple.Safari IncludeInternalDebugMenu -bool true defaults write com.apple.Safari IncludeDevelopMenu -bool true defaults write com.apple.Safari WebKitDeveloperExtrasEnabledPreferenceKey -bool true defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2DeveloperExtrasEnabled -bool true defaults write NSGlobalDomain WebKitDeveloperExtras -bool true killall Dock killall Finder killall Safari 2>/dev/null