1 # AX-ZSH: Alex' Modular ZSH Configuration
2 # 30_hostname.zprofile: Initialize hostname settings
4 # Setup legacy "HOSTNAME" variable (use "HOST"!)
5 [[ -z "$HOSTNAME" ]] && HOSTNAME="$HOST"
8 # Setup "SHORT_HOST" variable
9 if (( $+commands[scutil] )); then
10 SHORT_HOST=$(scutil --get ComputerName 2>/dev/null)
11 elif (( $+commands[hostnamectl] )); then
12 SHORT_HOST=$(hostnamectl --pretty 2>/dev/null)
13 [[ "$SHORT_HOST" =~ : ]] && unset SHORT_HOST
15 [[ -z "$SHORT_HOST" ]] && SHORT_HOST=${HOST/.*/}