summaryrefslogtreecommitdiff
path: root/zsh/env
diff options
context:
space:
mode:
authorGrégoire Duchêne <gduchene@awhk.org>2023-07-08 12:08:25 +0100
committerGrégoire Duchêne <gduchene@awhk.org>2023-07-08 12:08:25 +0100
commit6d720a1be90d19f6a785bec09354fbcd2a1a47ad (patch)
tree32783898c91a8818c1ce965a988ecaef141271dd /zsh/env
parentba07f6a54ffc59cf315282ebf4c9358f4a4e525c (diff)
zsh: Simplify how DOMAIN is defined
Diffstat (limited to 'zsh/env')
-rw-r--r--zsh/env2
1 files changed, 1 insertions, 1 deletions
diff --git a/zsh/env b/zsh/env
index e905bbb..5df08b1 100644
--- a/zsh/env
+++ b/zsh/env
@@ -8,9 +8,9 @@ source_if_exists() {
[[ -f $(dotfiles_root)/$1 ]] && . $(dotfiles_root)/$1 || return 0
}
-[[ ${HOST} =~ \\. ]] && export DOMAIN=${(j:.:)${(s:.:)HOST}[-2,-1]:l}
export HOST=${HOST:l}
export HOST_SHORT=${${(%):-%m}:l}
+export DOMAIN=${${${(%):-%M}#${HOST_SHORT}.}:l}
case ${OSTYPE} in
darwin*) export UNAME=darwin ;;
linux*) export UNAME=linux ;;