diff options
| author | Christoph Schlosser <christoph@linux.com> | 2025-06-18 19:01:01 +0200 |
|---|---|---|
| committer | Christoph Schlosser <christoph@linux.com> | 2025-06-18 19:01:01 +0200 |
| commit | 887655467ff1aea63dbbd612d475677d15e63940 (patch) | |
| tree | a0a4571dcf731ba04affd382a200e7e74de9de4b /functions | |
| parent | ad7b9498811a016c654cf7ad894cc1d079110ec0 (diff) | |
| download | c-star-887655467ff1aea63dbbd612d475677d15e63940.tar.gz | |
Add powerline styling
Diffstat (limited to 'functions')
| -rw-r--r-- | functions/fish_prompt.fish | 19 | ||||
| -rw-r--r-- | functions/fish_right_prompt.fish | 19 |
2 files changed, 36 insertions, 2 deletions
diff --git a/functions/fish_prompt.fish b/functions/fish_prompt.fish index 4d29852..832d8e8 100644 --- a/functions/fish_prompt.fish +++ b/functions/fish_prompt.fish @@ -1,3 +1,20 @@ +function c_star_segment_divide_left + set -l from_var "c_star_$argv[1]" + set -l from_name "$from_var""_bg" + set -l from $$from_name + set -l to_var "c_star_$argv[2]" + set -l to_name "$to_var""_bg" + set -l to $$to_name + + if test -z "$$from_var" + return + end + if test -z "$$to_var" + set -f to normal + end + echo (set_color -b $to $from)\uE0B0(set_color normal) +end + function fish_prompt --description "The left side of the C-Star prompt" - echo -e "$c_star_user$c_star_host $c_star_pwd $c_star_git\n$c_star_user_marker$c_star_prompt_symbol " + echo -e "$c_star_user$c_star_host$(c_star_segment_divide_left user pwd)$c_star_pwd$(c_star_segment_divide_left pwd git)$c_star_git$(c_star_segment_divide_left git normal)\n$c_star_user_marker$(c_star_segment_divide_left user_marker normal) " end
\ No newline at end of file diff --git a/functions/fish_right_prompt.fish b/functions/fish_right_prompt.fish index 34eb6ef..89cc89d 100644 --- a/functions/fish_right_prompt.fish +++ b/functions/fish_right_prompt.fish @@ -1,3 +1,20 @@ +function c_star_segment_divide_right + set -l from_var "c_star_$argv[1]" + set -l from_name "$from_var""_bg" + set -l from $$from_name + set -l to_var "c_star_$argv[2]" + set -l to_name "$to_var""_bg" + set -l to $$to_name + + if test -z "$$from_var" + return + end + if test -z "$$to_var" + set -f to normal + end + echo (set_color -b $to $from)\uE0B2(set_color normal) +end + function fish_right_prompt --description "The right side of the C-Star prompt" - echo -e "$c_star_command_time $c_star_datetime" + echo -e "$(c_star_segment_divide_right command_time normal)$c_star_command_time$(c_star_segment_divide_right datetime command_time)$c_star_datetime" end
\ No newline at end of file |