# Exit if it's not MacOS [[ "$(uname -s)" != "Darwin" ]] && return # Configuration if Brew installed () { local bp="" [[ -x /opt/homebrew/bin/brew ]] && bp="/opt/homebrew" [[ -x /usr/local/bin/brew ]] && bp="/usr/local" if [[ -n "$bp" ]]; then export HOMEBREW_AUTO_UPDATE_SECS=86400 export HOMEBREW_NO_ANALYTICS=1 if (( $+commands[gls] )); then # Використовуємо локальну змінну для аліасів alias ls="$bp/bin/gls --color=never -F --group-directories-first" alias date="$bp/bin/gdate" else [[ -t 1 ]] && echo "\e[33mNotice:\e[0m Coreutils not found. Run: brew install coreutils" fi fi } alias openfinder='open -a Finder $1' alias flushdns='sudo dscacheutil -flushcache' alias cleanup="find . -type f -name '*.DS_Store' -ls -delete" # This alias will find and delete all ".DS_Store" files in the current directory and all subdirectories. alias battery="pmset -g batt | grep -Eo '[0-9]+%' | sed 's/%//'"