]> arthur.barton.de Git - ax-zsh.git/blob - core/30_hostname/30_hostname.zprofile
a976ecd1bd95db059f68406788e1a6775cdc8800
[ax-zsh.git] / core / 30_hostname / 30_hostname.zprofile
1 # AX-ZSH: Alex' Modular ZSH Configuration
2 # 30_hostname.zprofile: Initialize hostname settings
3
4 # Setup "HOSTNAME" variable
5 [[ -z "$HOSTNAME" ]] && HOSTNAME=$( hostname )
6 export HOSTNAME
7
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 fi
14 [[ -z "$SHORT_HOST" ]] && SHORT_HOST=${HOST/.*/}
15 export SHORT_HOST