ohmybash / oh-my-bash

A delightful community-driven framework for managing your bash configuration, and an auto-update tool so that makes it easy to keep up with the latest updates from the community.
https://ohmybash.github.io
MIT License
5.54k stars 626 forks source link

How exactly can I set a custom theme? #465

Closed moshpirit closed 10 months ago

moshpirit commented 11 months ago

I changed the prompt of a theme in a copy on ~/.custom_ohmybash/powerline.bash. How do I set it as the theme I want to use?

akinomyoga commented 10 months ago

You need to put the file at ~/.custom_ohmybash/themes/powerline/powerline.theme.bash. Also, please do not forget to set OSH_CUSTOM=~/.custom_ohmybash.

moshpirit commented 10 months ago

You need to put the file at ~/.custom_ohmybash/themes/powerline/powerline.theme.bash. Also, please do not forget to set OSH_CUSTOM=~/.custom_ohmybash.

Thanks for replying! I guess I can't have several themes in the custom folder, right? Also, do I have to change it's name to "powerline .theme .bash"?

Correction: I've just realised I edited a module, not a theme, sorry. The first line is #! bash oh-my-bash.module

akinomyoga commented 10 months ago

Thanks for replying! I guess I can't have several themes in the custom folder, right?

You can have several themes in a custom folder. If you want to have another theme in the custom folder, you can include that at ~/.custom_ohmybash/themes/<NAME>/<NAME>.theme.bash where <NAME> is the name of the theme.

Also, do I have to change it's name to "powerline .theme .bash"?

Yes. Otherwise, OMB doesn't treat it as a theme.

Correction: I've just realised I edited a module, not a theme, sorry. The first line is #! bash oh-my-bash.module

The theme is a type of OMB module, so every theme is a module at the same time.

moshpirit commented 10 months ago

Sorry for bothering again, but what if I modify the base?

I have the powerline-multilne theme, only that I changed user_info="${USER}" for user_info=" ${USER}" in ~/.oh-my-bash/themes/powerline/powerline.base.sh. But it's not showing in the terminal. I can only see it in the prompt if I modify the original theme.

My current configuration is:

Bashrc

I think that the important variables here are:

export OSH='~/.oh-my-bash'
OSH_THEME="powerline"
OSH_CUSTOM=~/.custom_ohmybash/

Custom folders

~/.custom_ohmybash/themes/powerline/powerline.base.sh
~/.custom_ohmybash/themes/powerline/powerline.theme.sh
akinomyoga commented 10 months ago

what if I modify the base?

I have the powerline-multilne theme, only that I changed user_info="${USER}" for user_info=" ${USER}" in ~/.oh-my-bash/themes/powerline/powerline.base.sh.

In such a case, you also need to modify the path to powerline.base.sh in the following line of powerline.theme.sh:

https://github.com/ohmybash/oh-my-bash/blob/57c9300c644f9202c019c1bf7f537c72f9cccc2f/themes/powerline/powerline.theme.sh#L1-L3

moshpirit commented 10 months ago

GREAT! It's alive!!! Thanks a lot! Changing it to source "$OSH_CUSTOM/themes/powerline/powerline.base.sh" did the work!