oh-my-fish / theme-bobthefish

A Powerline-style, Git-aware fish theme optimized for awesome.
MIT License
1.46k stars 225 forks source link

Feature Suggestion: only fish_promtp and fish_right_prompt function in fish file #251

Closed mrvkino closed 4 years ago

mrvkino commented 4 years ago

Hi,

could it be possible to only have the fish_prompt function in the fish_promp.fish and the fish_right_prompt in the fish_right_promp.fish. And move all the support function in a separate file?

This would make it easier to "tweak" the theme without having to fork it (change the order an placement of elements). Unless you have another solution.

And it could be a first step to support this feature: https://github.com/oh-my-fish/theme-bobthefish/issues/176#issue-376903886

m-radzikowski commented 4 years ago

Exactly what I was looking for. I would like to add another thing displayed in the right prompt, but right now it looks like I have to copy whole fish_right_prompt.fish to my ~/.config/fish/functions/fish_right_prompt.fish just to display one additional variable. If the whole fish_right_prompt.fish would be a function with only those 4 lines:

    set_color $fish_color_autosuggestion

    __bobthefish_cmd_duration
    __bobthefish_timestamp
    set_color normal

then copying it and adding one more echo would be much cleaner.

bobthecow commented 4 years ago
source ~/.local/share/omf/themes/bobthefish/fish_right_prompt.fish

function fish_right_prompt
    set -l __bobthefish_left_arrow_glyph \uE0B3
    set_color $fish_color_autosuggestion
    __bobthefish_cmd_duration
    __bobthefish_timestamp
    echo " ($SHELL)"
    set_color normal
end
mrvkino commented 4 years ago

🤦‍♂️

Yup! that works. Should have thought of that.

Thanks