From 85446f029ccbf16a4077add67be9574be1c7f7db Mon Sep 17 00:00:00 2001 From: punkfairie <23287005+punkfairie@users.noreply.github.com> Date: Sun, 10 Mar 2024 11:56:39 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20feat(fish):=20Set=20env=20vars?= =?UTF-8?q?=20for=20machine=20info?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added $OS & $HOST global variables. --- .config/fish/conf.d/00-init.fish | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.config/fish/conf.d/00-init.fish b/.config/fish/conf.d/00-init.fish index f588925..c3f0e02 100644 --- a/.config/fish/conf.d/00-init.fish +++ b/.config/fish/conf.d/00-init.fish @@ -9,6 +9,15 @@ set -Ux XDG_CACHE_HOME "$HOME/.cache" set -Ux XDG_DATA_HOME "$HOME/.local/share" set -Ux XDG_STATE_HOME "$HOME/.local/state" +# Machine info. +set -gx OS "$(uname)" + +if command -v hostnamectl &>/dev/null + set -gx HOST "$(hostnamectl --static)" +else if command -v scutil &>/dev/null # macOS + set -gx HOST "$(scutil --get ComputerName)" +end + # Projects dir. set -gx HACK "$HOME/hackin"