summaryrefslogtreecommitdiff
path: root/jstmax_fish_prompts.fish
diff options
context:
space:
mode:
authorjstmax! <87650746+jstmaxlol@users.noreply.github.com>2025-05-22 22:33:41 +0200
committerGitHub <noreply@github.com>2025-05-22 22:33:41 +0200
commitf342f1d96dce653032094a2d74b89e678476b3ea (patch)
tree2d285cc7305b5b0e6ca35c73f82913bbf9a8ece1 /jstmax_fish_prompts.fish
parent2523790f36f2a8f341bc9759c8b37381c5f5b6b8 (diff)
#
Diffstat (limited to 'jstmax_fish_prompts.fish')
-rw-r--r--jstmax_fish_prompts.fish13
1 files 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