From fcd2c8c3de5778632f023d95ba55d9a9067ae2f2 Mon Sep 17 00:00:00 2001 From: czjstmax Date: Sat, 16 May 2026 17:13:57 +0200 Subject: new prompt Signed-off-by: czjstmax --- cfg/fish/fish_prompt.fish | 41 ++++++++++++++++++++++++++++++----------- 1 file changed, 30 insertions(+), 11 deletions(-) (limited to 'cfg/fish/fish_prompt.fish') diff --git a/cfg/fish/fish_prompt.fish b/cfg/fish/fish_prompt.fish index 916e276..b14256f 100644 --- a/cfg/fish/fish_prompt.fish +++ b/cfg/fish/fish_prompt.fish @@ -5,21 +5,40 @@ function fish_prompt if test "$cwd" = "$home" # if in ~ - echo -e (set_color white)"╭"(set_color red)"("(set_color white)"$user" \ - (set_color red)"⮞"(set_color white)"⮞"(set_color red)"⮞" \ - (set_color white)"~"(set_color red)")"(set_color red)"\n╰"(set_color normal)"⮞ " - # ╭(max⮞⮞⮞~) - # ╰⮞ + echo -e (set_color white)"("(set_color red)"$user"(set_color white)" at "(set_color red)"~"(set_color white)")\n" \ + (set_color white)"λ "(set_color normal) + # max at ~ + # λ else if string match -q "$home/*" $cwd set -l relative (string replace "$home/" "~/" $cwd) + set -l parts (string split "/" $relative) + set -l colored "" + + for p in $parts + if test -n "$p" + set colored $colored(set_color white)$p(set_color red)"/" + end + end + + set colored (string trim -r -c "/" $colored) + # if in a ~ subdir - echo -e (set_color white)"╭"(set_color red)"("(set_color white)"$user" \ - (set_color red)"⮞"(set_color white)"⮞"(set_color red)"⮞" \ - (set_color white)$relative(set_color red)")"(set_color red)"\n╰"(set_color normal)"⮞ " + echo -e (set_color white)"("(set_color red)"$user"(set_color white)" at "(set_color red)"$colored"(set_color white)")\n" \ + (set_color white)"λ "(set_color normal) else + set -l parts (string split "/" $cwd) + set -l colored "" + + for p in $parts + if test -n "$p" + set colored $colored(set_color white)$p(set_color red)"/" + end + end + + set colored (string trim -r -c "/" $colored) + set colored (set_color red)"#"$colored # if in any other dir - echo -e (set_color white)"╭"(set_color red)"("(set_color white)"$user" \ - (set_color red)"⮞"(set_color white)"⮞"(set_color red)"⮞" \ - (set_color white)$cwd(set_color red)")"(set_color red)"\n╰"(set_color normal)"⮞ " + echo -e (set_color white)"("(set_color red)"$user"(set_color white)" at "(set_color red)"$colored"(set_color white)")\n" \ + (set_color white)"λ "(set_color normal) end end -- cgit v1.3.1