From f342f1d96dce653032094a2d74b89e678476b3ea Mon Sep 17 00:00:00 2001 From: jstmax! <87650746+jstmaxlol@users.noreply.github.com> Date: Thu, 22 May 2025 22:33:41 +0200 Subject: # --- jstmax_fish_prompts.fish | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/jstmax_fish_prompts.fish b/jstmax_fish_prompts.fish index 78f3f8f..5c0f52d 100644 --- a/jstmax_fish_prompts.fish +++ b/jstmax_fish_prompts.fish @@ -1,9 +1,16 @@ # fish_prompt function fish_prompt - if test "$PWD" = "/home/max" # change max with your username :3 - echo -e (set_color green)$USER(set_color white)"@"(set_color green)"~"(set_color white)" :: " + set -l user (set_color green)$USER(set_color white)"@" + set -l cwd $PWD + set -l home $HOME + + if test "$cwd" = "$home" + echo -e "$user"(set_color green)"~"(set_color white)" ::> " + else if string match -q "$home/*" $cwd + set -l relative (string replace "$home/" "~/"$cwd) + echo -e "$user"(set_color green)$relative(set_color white)" ::> " else - echo -e (set_color green)$USER(set_color white)"@"(set_color green)$PWD(set_color white)" :: " + echo -e "$user"(set_color green)$cwd(set_color white)" ::> " end end -- cgit v1.3.1