Something went wrong. Try again.
๐
๐ผ My dotfiles, now on tangled.
dotfiles
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293#!/bin/bashset -euo pipefailDOTFILES_DIR="$(cd "$(dirname "$0")/.." && pwd)"SETUP_DIR="$DOTFILES_DIR/setup"# ===========================================================================# Symlinks# ==========================================================================="$SETUP_DIR/symlinks"# ===========================================================================# Shell# ===========================================================================echo ""echo "Setting up shell..."FISH_PATH=$(command -v fish)if [ -n "$FISH_PATH" ]; then grep -Fxq "$FISH_PATH" /etc/shells || echo "$FISH_PATH" | sudo tee -a /etc/shells [ "$SHELL" != "$FISH_PATH" ] && chsh -s "$FISH_PATH"fimkdir -p ~/.ssh && chmod 700 ~/.sshmkdir -p ~/repos# ===========================================================================# Packages# ===========================================================================echo ""if [ "$(uname)" = "Darwin" ]; then echo "Installing Homebrew packages..." # Homebrew 6+ refuses to load formulae from non-official taps until they're # trusted. Trust the taps the Brewfile declares so `brew bundle` doesn't fail. grep -oE '^tap "[^"]+"' "$DOTFILES_DIR/Brewfile" \ | sed -E 's/^tap "([^"]+)"/\1/' \ | while read -r tap; do brew trust --tap "$tap"; done brew bundle --file="$DOTFILES_DIR/Brewfile"fi# ===========================================================================# Plugins (git submodules)# ===========================================================================echo ""echo "Initialising submodules..."git -C "$DOTFILES_DIR" submodule update --init --recursivecommand -v bat >/dev/null && bat cache --buildcommand -v nvim >/dev/null && nvim --headless "+Lazy! sync" +qa# ===========================================================================# App icons# ===========================================================================if [ "$(uname)" = "Darwin" ]; then echo "" echo "Applying app icons..." "$SETUP_DIR/icons-apply"fi# ===========================================================================# macOS defaults# ===========================================================================if [ "$(uname)" = "Darwin" ]; then echo "" echo "Applying macOS defaults..." macos-defaults apply "$SETUP_DIR/macos-defaults.d/" # Show the ~/Library folder chflags nohidden ~/Library # Reveal IP, hostname, OS version etc. when clicking the clock in the login window. # /Library/Preferences requires root, so this only runs when not already set. if [ "$(defaults read /Library/Preferences/com.apple.loginwindow AdminHostInfo 2>/dev/null)" != "HostName" ]; then sudo defaults write /Library/Preferences/com.apple.loginwindow AdminHostInfo HostName fi # Timezone โ symlinking /etc/localtime requires root, so only when not already set. if [ "$(readlink /etc/localtime)" != "/var/db/timezone/zoneinfo/Europe/Amsterdam" ]; then sudo ln -sf /var/db/timezone/zoneinfo/Europe/Amsterdam /etc/localtime fifiecho ""echo "Done."