From b5da6adeb2df25b7d4c8f8d713a62c81b8d777db Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Mon, 1 Mar 2021 14:52:06 -0600 Subject: [PATCH] Make fish greeting macOS-friendly --- apps/shell/fish/config.fish | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/shell/fish/config.fish b/apps/shell/fish/config.fish index 851c961..f39e33b 100755 --- a/apps/shell/fish/config.fish +++ b/apps/shell/fish/config.fish @@ -33,8 +33,8 @@ function fish_greeting; set_color -b black brblack printf "%s@%s %s\n" $USER (hostname) (date) printf "%6d processes running\n" (ps -aux | wc -l) - printf "%6sGB memory available\n" (free -g | grep '^Mem:' | tr -s ' ' | cut -d ' ' -f7) - printf "%6d PTYs open\n" (cat /proc/sys/kernel/pty/nr) + has_command free && printf "%6sGB memory available\n" (free -g | grep '^Mem:' | tr -s ' ' | cut -d ' ' -f7) + test -f /proc/sys/kernel/pty/nr && printf "%6d PTYs open\n" (cat /proc/sys/kernel/pty/nr) end # we assume the user uses "$HOME" to just store their mess of dotfiles and other