Files
mac_os/mac_os-config/bin/install_basics
Andreas Düren 34ffaf6726 Add custom fonts backup and restore
Fonts included:
- Barlow (18 variants)
- Barlow Semi Condensed (18 variants)
- Berkeley Mono (4 variants)
- Poppins (18 variants)

Fonts are installed during 'install_basics' step.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 08:45:36 -06:00

45 lines
1.4 KiB
Bash
Executable File

#! /usr/bin/env bash
# Installs basic system settings.
read -p "What is this machine's label (Example: \"Alchemist\")? " mac_os_label
if [[ -z "$mac_os_label" ]]; then
printf "%s\n" "ERROR: Invalid MacOS label."
exit 1
fi
read -p "What is this machine's name (Example: \"alchemist\")? " mac_os_name
if [[ -z "$mac_os_name" ]]; then
printf "%s\n" "ERROR: Invalid MacOS name."
exit 1
fi
read -p "Delete all files in $HOME/Documents (y/n)? " documents
if [[ "$documents" == "y" ]]; then
rm -rf "$HOME/Documents/*"
printf "%s\n" "Documents deleted."
fi
read -p "Delete all files in $HOME/Downloads (y/n)? " downloads
if [[ "$downloads" == "y" ]]; then
rm -rf "$HOME/Downloads/*"
printf "%s\n" "Downloads deleted."
fi
read -p "Change /usr/local ownership to $USER:staff (y/n)? " ownership
if [[ "$ownership" == "y" ]]; then
sudo chown -R "$USER":staff /usr/local
printf "%s\n" "Ownership changed."
fi
printf "Setting system label and name...\n"
sudo scutil --set ComputerName "$mac_os_label"
sudo scutil --set HostName "$mac_os_name"
sudo scutil --set LocalHostName "$mac_os_name"
sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server NetBIOSName -string $mac_os_name
printf "Installing custom fonts...\n"
mkdir -p "$HOME/Library/Fonts"
cp -n "$MAC_OS_CONFIG_PATH/fonts/"* "$HOME/Library/Fonts/" 2>/dev/null || true
printf "Fonts installed.\n"