Add macOS system preferences and fix package installations

- Fix claude-code package name (was incorrectly listed as claude-cli)
- Remove Node.js from installer (still required by gemini-cli)
- Add macOS system preferences configuration: auto-hide Dock, show hard disks, show all file extensions, auto-empty trash after 30 days
- Add Touch ID for sudo support (artginzburg/tap/sudo-touchid)
- Add automatic Homebrew updates (every 12 hours with upgrade and cleanup)
- Add new 's' option to configure system preferences separately

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Andreas Düren
2026-01-09 19:14:23 -06:00
parent bf255df1ff
commit a35b6baaa5
6 changed files with 116 additions and 17 deletions

38
bin/configure_macos Executable file
View File

@@ -0,0 +1,38 @@
#! /usr/bin/env bash
# Configures macOS system preferences.
set -o nounset
set -o errexit
set -o pipefail
IFS=$'\n\t'
printf "\n🔧 Configuring macOS system preferences...\n\n"
# Hide the Dock
printf " • Hiding Dock automatically...\n"
defaults write com.apple.dock autohide -bool true
# Show hard disks on desktop
printf " • Showing hard disks on desktop...\n"
defaults write com.apple.finder ShowHardDrivesOnDesktop -bool true
defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool true
# Show user home folder in Finder sidebar
printf " • Adding user home folder to Finder sidebar...\n"
defaults write com.apple.sidebarlists systemitems -dict-add ShowUserHome -bool true
# Show all file extensions
printf " • Showing all file extensions...\n"
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
# Remove items from trash after 30 days
printf " • Setting trash to empty after 30 days...\n"
defaults write com.apple.finder FXRemoveOldTrashItems -bool true
# Restart affected applications
printf "\n🔄 Restarting Finder and Dock to apply changes...\n"
killall Finder
killall Dock
printf "\n✅ macOS system preferences configured successfully!\n"

View File

@@ -25,6 +25,7 @@ brew install --cask proton-mail
brew install --cask protonvpn brew install --cask protonvpn
# Development # Development
brew install --cask claude-code
brew install --cask codex brew install --cask codex
brew tap steipete/tap brew tap steipete/tap
brew install --cask steipete/tap/codexbar brew install --cask steipete/tap/codexbar

View File

@@ -14,14 +14,14 @@ install_homebrew
brew install atuin brew install atuin
brew install bash brew install bash
brew install bash-completion brew install bash-completion
brew install pinentry-mac
brew tap artginzburg/tap
brew install artginzburg/tap/sudo-touchid
brew tap domt4/autoupdate
# AI # AI
brew install claude-cli
brew install gemini-cli brew install gemini-cli
# Development
brew install node
# Media # Media
brew install ffmpeg brew install ffmpeg
@@ -31,4 +31,9 @@ brew install mole
brew install rename brew install rename
brew install ykman brew install ykman
# Configure automatic updates
printf "\n🔧 Configuring automatic Homebrew updates...\n"
mkdir -p ~/Library/LaunchAgents
brew autoupdate start 43200 --upgrade --cleanup --immediate --sudo 2>/dev/null || printf "⚠️ Failed to configure brew autoupdate\n"
printf "\n✅ Homebrew Formulas installation complete!\n" printf "\n✅ Homebrew Formulas installation complete!\n"

View File

@@ -18,6 +18,7 @@ while true; do
printf "%s\n" " hf: Install Homebrew Formulas." printf "%s\n" " hf: Install Homebrew Formulas."
printf "%s\n" " hc: Install Homebrew Casks." printf "%s\n" " hc: Install Homebrew Casks."
printf "%s\n" " m: Install Mac App Store software." printf "%s\n" " m: Install Mac App Store software."
printf "%s\n" " s: Configure macOS system preferences."
printf "%s\n" " i: Install all (executes all of the above steps in order)." printf "%s\n" " i: Install all (executes all of the above steps in order)."
printf "%s\n" " Manage:" printf "%s\n" " Manage:"
printf "%s\n" " c: Check status of installed software." printf "%s\n" " c: Check status of installed software."

View File

@@ -95,18 +95,23 @@ fi
print_section "Installing Homebrew Formulas (CLI tools)..." print_section "Installing Homebrew Formulas (CLI tools)..."
# Add custom taps
print_info "Adding custom taps..."
brew tap artginzburg/tap
brew tap domt4/autoupdate
FORMULAS=( FORMULAS=(
"atuin" # Shell history "atuin" # Shell history
"bash" # Updated bash "bash" # Updated bash
"bash-completion" # Bash completions "bash-completion" # Bash completions
"claude-cli" # Claude AI CLI "pinentry-mac" # GPG pin entry (required for brew autoupdate --sudo)
"gemini-cli" # Gemini AI CLI "artginzburg/tap/sudo-touchid" # Touch ID for sudo
"node" # Node.js "gemini-cli" # Gemini AI CLI
"ffmpeg" # Media processing "ffmpeg" # Media processing
"mas" # Mac App Store CLI "mas" # Mac App Store CLI
"mole" # SSH tunneling "mole" # SSH tunneling
"rename" # Rename utility "rename" # Rename utility
"ykman" # YubiKey manager "ykman" # YubiKey manager
) )
for formula in "${FORMULAS[@]}"; do for formula in "${FORMULAS[@]}"; do
@@ -133,6 +138,7 @@ CASKS=(
"proton-drive" # Proton Drive "proton-drive" # Proton Drive
"proton-mail" # Proton Mail "proton-mail" # Proton Mail
"protonvpn" # Proton VPN "protonvpn" # Proton VPN
"claude-code" # Claude AI coding assistant
"codex" # AI coding assistant "codex" # AI coding assistant
"nova" # Nova editor "nova" # Nova editor
"transmit" # FTP client "transmit" # FTP client
@@ -264,6 +270,51 @@ else
print_info "Berkeley Mono already installed" print_info "Berkeley Mono already installed"
fi fi
# =============================================================================
# STEP 7: Configure macOS System Preferences
# =============================================================================
print_section "Configuring macOS system preferences..."
# Hide the Dock
print_info "Hiding Dock automatically"
defaults write com.apple.dock autohide -bool true
# Show hard disks on desktop
print_info "Showing hard disks on desktop"
defaults write com.apple.finder ShowHardDrivesOnDesktop -bool true
defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool true
# Show user home folder in Finder sidebar
print_info "Adding user home folder to Finder sidebar"
defaults write com.apple.sidebarlists systemitems -dict-add ShowUserHome -bool true
# Show all file extensions
print_info "Showing all file extensions"
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
# Remove items from trash after 30 days
print_info "Setting trash to empty after 30 days"
defaults write com.apple.finder FXRemoveOldTrashItems -bool true
# Restart affected applications
print_info "Restarting Finder and Dock to apply changes"
killall Finder 2>/dev/null || true
killall Dock 2>/dev/null || true
# =============================================================================
# STEP 8: Configure Post-Install Services
# =============================================================================
print_section "Configuring services..."
# Create LaunchAgents directory if it doesn't exist
mkdir -p "$HOME/Library/LaunchAgents"
# Enable automatic Homebrew updates
print_info "Enabling automatic Homebrew updates (every 12 hours)"
brew autoupdate start 43200 --upgrade --cleanup --immediate --sudo 2>/dev/null || print_warning "Failed to configure brew autoupdate"
# ============================================================================= # =============================================================================
# COMPLETION # COMPLETION
# ============================================================================= # =============================================================================
@@ -273,6 +324,6 @@ print_section "Installation Complete!"
printf "\n${GREEN}${NC} All software has been installed successfully!\n" printf "\n${GREEN}${NC} All software has been installed successfully!\n"
printf "\n${YELLOW}Next steps:${NC}\n" printf "\n${YELLOW}Next steps:${NC}\n"
printf " 1. Restart your terminal to use Homebrew commands\n" printf " 1. Restart your terminal to use Homebrew commands\n"
printf " 2. Configure installed applications as needed\n" printf " 2. Enable Touch ID for sudo: ${GREEN}sudo brew services start artginzburg/tap/sudo-touchid${NC}\n"
printf " 3. (Optional) Install Berkeley Mono font manually from https://berkeleygraphics.com/typefaces/berkeley-mono/\n" printf " 3. Configure installed applications as needed\n"
printf "\n${GREEN}Enjoy your new macOS setup!${NC}\n\n" printf "\n${GREEN}Enjoy your new macOS setup!${NC}\n\n"

View File

@@ -22,6 +22,8 @@ process_option() {
bin/install_homebrew_casks;; bin/install_homebrew_casks;;
'm') 'm')
bin/install_app_store;; bin/install_app_store;;
's')
bin/configure_macos;;
'i') 'i')
caffeinate_machine caffeinate_machine
bin/install_basics bin/install_basics
@@ -29,6 +31,7 @@ process_option() {
bin/install_homebrew_formulas bin/install_homebrew_formulas
bin/install_homebrew_casks bin/install_homebrew_casks
bin/install_app_store bin/install_app_store
bin/configure_macos
clean_work_path clean_work_path
printf "\n🎉 ${GREEN}Installation Complete!${NC}\n\n" printf "\n🎉 ${GREEN}Installation Complete!${NC}\n\n"
printf "✅ All software has been installed successfully!\n\n" printf "✅ All software has been installed successfully!\n\n"