From fd2f8bd75233de72ea8a7002ff120d2a3011657f Mon Sep 17 00:00:00 2001 From: mat ess Date: Mon, 27 Jun 2022 15:02:02 -0400 Subject: [PATCH] Set background to macOS on cd --- home/shells.nix | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/home/shells.nix b/home/shells.nix index 1d0d148..86e55ce 100644 --- a/home/shells.nix +++ b/home/shells.nix @@ -68,14 +68,17 @@ # Set `$term_background` based on whether macOS is light or dark mode. Other Fish functions # trigger when this variable changes. We use a universal variable so that all instances of Fish # have the same value for the variable. - set-background-to-macOS.body = '' - # Returns 'Dark' if in dark mode fails otherwise. - if defaults read -g AppleInterfaceStyle &>/dev/null - set -U term_background dark - else - set -U term_background light - end - ''; + set-background-to-macOS = { + body = '' + # Returns 'Dark' if in dark mode fails otherwise. + if defaults read -g AppleInterfaceStyle &>/dev/null + set -U term_background dark + else + set -U term_background light + end + ''; + onVariable = "PWD"; + }; # Sets Fish Shell to light or dark colorscheme based on `$term_background`. set-shell-colors = {