From 16c8bb12b6fd436f9523eb911f4df8ef3e2b3467 Mon Sep 17 00:00:00 2001 From: dogeystamp Date: Wed, 6 Jul 2022 11:56:09 -0400 Subject: [PATCH] fish: add custom prompt for ssh-agent as well as tmux --- src/.config/fish/config.fish | 2 +- src/.config/fish/functions/extra_prompt.fish | 19 +++++++++++++++++++ src/.config/fish/functions/tmux_prompt.fish | 12 ------------ 3 files changed, 20 insertions(+), 13 deletions(-) create mode 100644 src/.config/fish/functions/extra_prompt.fish delete mode 100644 src/.config/fish/functions/tmux_prompt.fish diff --git a/src/.config/fish/config.fish b/src/.config/fish/config.fish index 879c8fd..af021b5 100644 --- a/src/.config/fish/config.fish +++ b/src/.config/fish/config.fish @@ -4,7 +4,7 @@ end source ~/.config/fish/aliases.fish -source ~/.config/fish/functions/tmux_prompt.fish +source ~/.config/fish/functions/extra_prompt.fish # Set GPG_TTY gpgt diff --git a/src/.config/fish/functions/extra_prompt.fish b/src/.config/fish/functions/extra_prompt.fish new file mode 100644 index 0000000..3d3fd0b --- /dev/null +++ b/src/.config/fish/functions/extra_prompt.fish @@ -0,0 +1,19 @@ +# python venv style prompt replacement + +if set -q TMUX + functions -c fish_prompt tmux_old_fish_prompt + + function fish_prompt + printf "%s%s%s" (set_color 809C80) "(tmux) " (set_color normal) + tmux_old_fish_prompt + end +end + +if set -q SSH_AGENT_PID + functions -c fish_prompt ssha_old_fish_prompt + + function fish_prompt + printf "%s%s%s" (set_color 9C8080) "(ssha) " (set_color normal) + ssha_old_fish_prompt + end +end diff --git a/src/.config/fish/functions/tmux_prompt.fish b/src/.config/fish/functions/tmux_prompt.fish deleted file mode 100644 index 519e162..0000000 --- a/src/.config/fish/functions/tmux_prompt.fish +++ /dev/null @@ -1,12 +0,0 @@ -if set -q TMUX - - # python venv style prompt replacement - functions -c fish_prompt _old_fish_prompt - - function fish_prompt - printf "%s%s%s" (set_color 809C80) "(tmux) " (set_color normal) - _old_fish_prompt - end - - printf "aawagga" -end