diff --git a/Brewfile b/Brewfile new file mode 100644 index 0000000..a09c987 --- /dev/null +++ b/Brewfile @@ -0,0 +1,48 @@ +tap "homebrew/bundle" +tap "homebrew/cask-fonts" +tap "homebrew/services" +brew "xz" +brew "openssl@3" +brew "readline" +brew "sqlite" +brew "php" +brew "composer" +brew "dnsmasq" +brew "ffmpeg" +brew "git" +brew "imagemagick" +brew "mas" +brew "nginx" +brew "nvm" +brew "pipx" +brew "pkg-config" +brew "pyenv" +brew "tcl-tk" +brew "yt-dlp" +brew "zlib" +cask "1password" +cask "adguard" +cask "arq" +cask "bbedit" +cask "choosy" +cask "dbngin" +cask "discord" +cask "firefox" +cask "font-jetbrains-mono" +cask "mullvad-browser" +cask "mullvadvpn" +cask "netnewswire" +cask "obsidian" +cask "onyx" +cask "rectangle" +cask "responsively" +cask "sequel-ace" +cask "syncthing" +cask "transmit" +cask "visual-studio-code" +cask "vlc" +cask "vmware-fusion" +mas "Numbers", id: 409203825 +mas "Pages", id: 409201541 +mas "Pixelmator Pro", id: 1289583905 +mas "Xcode", id: 497799835 \ No newline at end of file diff --git a/Dock.sh b/Dock.sh new file mode 100755 index 0000000..bfcfbad --- /dev/null +++ b/Dock.sh @@ -0,0 +1,40 @@ +#!/bin/bash +LOGGED_USER=`stat -f%Su /dev/console` +sudo su $LOGGED_USER -c 'defaults delete com.apple.dock persistent-apps' + +dock_item() { + + printf 'tile-datafile-data_CFURLString%s_CFURLStringType0', "$1" + +} + +settings=$(dock_item /System/Applications/System\ Settings.app) +launch=$(dock_item /System/Applications/Launchpad.app) +terminal=$(dock_item /System/Applications/Utilities/Terminal.app) +calendar=$(dock_item /System/Applications/Calendar.app) +reminders=$(dock_item /System/Applications/Reminders.app) +mail=$(dock_item /System/Applications/Mail.app) +rss=$(dock_item /Applications/NetNewsWire.app) +messages=$(dock_item /System/Applications/Messages.app) +discord=$(dock_item /Applications/Discord.app) +firefox=$(dock_item /Applications/Firefox.app) +safari=$(dock_item /System/Cryptexes/App/System/Applications/Safari.app) +music=$(dock_item /System/Applications/Music.app) +video=$(dock_item /System/Applications/QuickTime\ Player.app) +video2=$(dock_item /Applications/VLC.app) +notes=$(dock_item /System/Applications/Notes.app) +notes2=$(dock_item /Applications/Obsidian.app) +pages=$(dock_item /Applications/Pages.app) +numbers=$(dock_item /Applications/Numbers.app) +photos=$(dock_item /System/Applications/Photos.app) +pixel=$(dock_item /Applications/Pixelmator\ Pro.app) +vscode=$(dock_item /Applications/Visual\ Studio\ Code.app) +rwd=$(dock_item /Applications/ResponsivelyApp.app) +db=$(dock_item /Applications/Sequel\ Ace.app) +ftp=$(dock_item /Applications/Transmit.app) +xcode=$(dock_item /Applications/Xcode.app) +xcodesim=$(dock_item /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app) +textedit=$(dock_item /Applications/BBEdit.app) + +sudo su $LOGGED_USER -c "defaults write com.apple.dock persistent-apps -array '$settings' '$launch' '$terminal' '$calendar' '$reminders' '$mail' '$rss' '$messages' '$discord' '$firefox' '$safari' '$music' '$video' '$video2' '$notes' '$notes2' '$pages' '$numbers' '$photos' '$pixel' '$vscode' '$rwd' '$db' '$ftp' '$xcode' '$xcodesim' '$textedit' " +killall Dock \ No newline at end of file diff --git a/setup.sh b/setup.sh new file mode 100755 index 0000000..44c3cd0 --- /dev/null +++ b/setup.sh @@ -0,0 +1,101 @@ +#!/bin/bash + +echo "Configuring macOS System Settings (you may be asked to enter password)" + +# Enable and configure firewall +sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate on +sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setstealthmode on + +# Set DNS servers +networksetup -setdnsservers Ethernet 1.1.1.1 1.0.0.1 2606:4700:4700::1111 2606:4700:4700::1001 +networksetup -setdnsservers Wi-Fi 1.1.1.1 1.0.0.1 2606:4700:4700::1111 2606:4700:4700::1001 + +# Disable Handoff +defaults -currentHost write com.apple.coreservices.useractivityd ActivityAdvertisingAllowed -bool no +defaults -currentHost write com.apple.coreservices.useractivityd ActivityReceivingAllowed -bool no + +# Configure the Dock +# Disable "Show recent applications in Dock" +defaults write com.apple.dock "show-recents" -bool FALSE +# Set "Minimise windows using" to "Scale Effect" +defaults write com.apple.dock mineffect scale +# Enable "Minimise windows into application icon" +defaults write com.apple.dock "minimize-to-application" -bool TRUE + +# Set numbers of rows and columns in Launchpad +defaults write com.apple.dock springboard-columns -int 6; +defaults write com.apple.dock springboard-columns -int 6; + +# Increase mouse speed beyond available options in System Settings +echo "Increase mouse speed" +defaults write -g com.apple.mouse.scaling 9 + +# Configure Finder +echo "Configuring Finder" +# Set list view as default +defaults write com.apple.finder FXPreferredViewStyle -string "Nlsv" +# Show the path and status bars (TODO: setting for tabs bar) +defaults write com.apple.finder ShowPathbar -bool true +defaults write com.apple.finder ShowStatusBar -bool true +# Sort files so directories appear above files +defaults write com.apple.finder _FXSortFoldersFirst -bool true +# Set the default search scope to be the current folder +defaults write com.apple.finder FXDefaultSearchScope -string "SCcf" +# Set default location for Finder to the home directory +defaults write com.apple.finder "NewWindowTarget" -string "PfHm" +defaults write com.apple.finder "NewWindowTargetPath" -string "file://${HOME}/" + +# Create location for saving screenshots and set it as the default +# Also remove shadow effect macOS adds to window screenshots +echo "- Screenshots saved to ~/Pictures/Screenshots with shadow effects disabled" +mkdir -p ~/Pictures/Screenshots +defaults write com.apple.screencapture location -string "${HOME}/Pictures/Screenshots" +defaults write com.apple.screencapture disable-shadow -bool true +# Avoid creating .DS_Store files on network or USB volumes +# ToDo - Check if this actually works +echo "- Avoid creating .DS_Store files on external volumes" +defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true +defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true + +# Install Homebrew +/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + +# Run Homebrew bundle with specified file +brew bundle --file Brewfile +# Run bash script to reconfigure Dock +./Dock.sh + +# Applescript to open up Terminal using the downloaded theme +mv Custom.terminal ~/Downloads/Custom.terminal +osascript <