From ba07f6a54ffc59cf315282ebf4c9358f4a4e525c Mon Sep 17 00:00:00 2001 From: GrĂ©goire DuchĂȘne Date: Sat, 8 Jul 2023 12:03:19 +0100 Subject: zsh: Add HOST_SHORT to refer to the machine name --- emacs/early-init.el | 2 +- zsh/env | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/emacs/early-init.el b/emacs/early-init.el index a83816f..a4f99c7 100644 --- a/emacs/early-init.el +++ b/emacs/early-init.el @@ -8,7 +8,7 @@ (defun my/load-file-variations (filename) "Load variations of FILENAME that may exist in other dotfiles directories." - (dolist (elt '("${UNAME}" "${DOMAIN}" "${HOST}")) + (dolist (elt '("${UNAME}" "${DOMAIN}" "${HOST_SHORT}" "${HOST}")) (my/load-file (format "dotfiles-%s/%s" elt filename)))) (my/load-file "emacs/functions") diff --git a/zsh/env b/zsh/env index 8bfe0fb..e905bbb 100644 --- a/zsh/env +++ b/zsh/env @@ -10,6 +10,7 @@ source_if_exists() { [[ ${HOST} =~ \\. ]] && export DOMAIN=${(j:.:)${(s:.:)HOST}[-2,-1]:l} export HOST=${HOST:l} +export HOST_SHORT=${${(%):-%m}:l} case ${OSTYPE} in darwin*) export UNAME=darwin ;; linux*) export UNAME=linux ;; -- cgit v1.2.3-70-g09d2