From ac7ea95ba764e1e620067fb04e6a8dc787f062cf Mon Sep 17 00:00:00 2001 From: Andrew Williams Date: Sun, 4 Jan 2026 00:08:00 +0000 Subject: [PATCH] [macos] Tidy macOS module --- macos/.config/homebrew/Brewfile | 15 ++++++------ macos/.config/shell-common/macos.sh | 36 ++++++++++++++++++++++++++--- 2 files changed, 41 insertions(+), 10 deletions(-) diff --git a/macos/.config/homebrew/Brewfile b/macos/.config/homebrew/Brewfile index d19486e..b6d273a 100644 --- a/macos/.config/homebrew/Brewfile +++ b/macos/.config/homebrew/Brewfile @@ -1,19 +1,24 @@ cask_args appdir: "~/Applications" tap "dart-lang/dart" +tap "felixkratz/formulae" tap "fluxcd/tap" tap "go-task/tap" +tap "hashicorp/tap" tap "localstack/tap" +tap "nikitabobko/tap" tap "sass/sass" brew "awscli" brew "awslogs" brew "coreutils" brew "dockutil" +brew "felixkratz/formulae/borders" brew "fluxcd/tap/flux" brew "fzf" brew "go-task/tap/go-task" brew "go" +brew "hashicorp/tap/packer" brew "hashicorp/tap/terraform" brew "helm" brew "hugo" @@ -23,11 +28,9 @@ brew "kubectl-cnpg" brew "kubelogin" brew "kubernetes-cli" brew "kubeseal" -brew "localstack-cli" +brew "localstack/tap/localstack-cli" brew "mas" -brew "packer" brew "poetry" -brew "python@3.14" brew "sass/sass/sass" brew "shellcheck" brew "smartmontools" @@ -38,6 +41,7 @@ brew "tz" brew "uv" brew "yazi" +cask "aerospace" cask "appcleaner" cask "balenaetcher" cask "clop" @@ -67,17 +71,14 @@ cask "font-jetbrains-mono" mas "AmorphousDiskMark", id: 1168254295 mas "Amphetamine", id: 937984704 mas "Bitwarden", id: 1352778147 -mas "Discovery - DNS-SD Browser", id: 1381004916 -mas "Flighty – Live Flight Tracker", id: 1358823008 +mas "Discovery", id: 1381004916 mas "Hand Mirror", id: 1502839586 mas "Hidden Bar", id: 1452453066 mas "Home Assistant", id: 1099568401 -mas "Hush Nag Blocker", id: 1544743900 mas "Hush", id: 1544743900 mas "Ivory", id: 6444602274 mas "MQTT Explorer", id: 1455214828 mas "OTP Auth", id: 1471867429 -mas "ReadKit - Reading Hub", id: 1615798039 mas "Tailscale", id: 1475387142 mas "Telegram", id: 747648890 mas "The Unarchiver", id: 425424353 diff --git a/macos/.config/shell-common/macos.sh b/macos/.config/shell-common/macos.sh index c335cc3..0fe0854 100644 --- a/macos/.config/shell-common/macos.sh +++ b/macos/.config/shell-common/macos.sh @@ -1,3 +1,22 @@ +# shellcheck shell=bash + +# Override XDG cache location for macOS to use the standard Library/Caches directory +export XDG_CACHE_HOME="$HOME/Library/Caches" +export XDG_RUNTIME_DIR="${TMPDIR}runtime-${UID}" + +# Configure Homebrew environment +export HOMEBREW_NO_ENV_HINTS=1 +[ -d /opt/homebrew ] && eval "$(/opt/homebrew/bin/brew shellenv)" + +# Flushes the DNS cache on macOS +function flushdns() { + if [[ $(uname) == "Darwin" ]]; then + sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder; echo 'DNS cache flushed.' + else + echo 'This only works on macOS...' + fi +} + # macOS tags downloads with "com.apple.quarantine" attribute to prevent execution of downloaded files until the user explicitly allows it. # This function removes that attribute, allowing the file to be opened without warning. # Usage: itsok @@ -35,6 +54,17 @@ function update-dock() { killall Dock } -# Override XDG cache location for macOS to use the standard Library/Caches directory -export XDG_CACHE_HOME="$HOME/Library/Caches" -export XDG_RUNTIME_DIR="${TMPDIR}runtime-${UID}" +# Fuzzy find and focus a window using aerospace and fzf +if [ -x "$(command -v aerospace)" ] && [ -x "$(command -v fzf)" ]; then + function ff() { + aerospace list-windows --all | fzf --height 40% --layout=reverse --border --ansi | awk '{print $1}' | xargs -I {} aerospace focus --window-id {} + } +fi + +alias ls="ls -FG" + +# Use Tailscale binary if installed via app +if [ -d "/Applications/Tailscale.app" ]; then + alias tailscale="/Applications/Tailscale.app/Contents/MacOS/Tailscale" + alias ts="/Applications/Tailscale.app/Contents/MacOS/Tailscale" +fi