eendroroy / alien

An asynchronous zsh prompt
https://eendroroy.github.io/alien
MIT License
307 stars 45 forks source link

User-defined components #28

Closed ryanrhee closed 4 years ago

ryanrhee commented 4 years ago

Is there a way to add user-defined components?

eendroroy commented 4 years ago

Currently there is no option for that.

betaboon commented 4 years ago

@ryanrhee the easiest way right now is to add a section like this: https://github.com/eendroroy/alien/blob/master/modules/sections.zsh#L6

you can then refer to a section in your config by the text after the last _. eg. define a section called alien_prompt_section_foobar then use it in your config as foobar

eendroroy commented 4 years ago

@ryanrhee the easiest way right now is to add a section like this: https://github.com/eendroroy/alien/blob/master/modules/sections.zsh#L6

you can then refer to a section in your config by the text after the last _. eg. define a section called alien_prompt_section_foobar then use it in your config as foobar

That is modifying the original theme, right?

betaboon commented 4 years ago

@ryanrhee @eendroroy i guess it would also be possible to create a file (eg. my-alien-sections.zsh) that defines your custom alien_prompt_section_foobarand then source it before sourcing alien (with your zsh-plugin-manager eg antibody).

that seems to work as well

eendroroy commented 4 years ago

@betaboon May be we can create a configuration option for ALIEN_CUSTOM_SECTIONS_PATH like ALIEN_CUSTOM_THEME_PATH:

export ALIEN_CUSTOM_SECTIONS_PATH=/path/to/custom/sections

It will source all zsh files from /path/to/custom/sections

ryanrhee commented 4 years ago

Could also check a path by default? something like ${HOME}/.alien/custom/sections

betaboon commented 4 years ago

i dislike the idea of checking a path by default.

betaboon commented 4 years ago

@ryanrhee is your request solved by the provided information ?

ryanrhee commented 4 years ago

I'll try defining a custom section and using it my config.

will the alien_prompt_section_ prefix ever change?

betaboon commented 4 years ago

@ryanrhee i currently do not see any reason for the prefix changing. though it can obviously not be ruled out ;)

can this issue be closed ?

ryanrhee commented 4 years ago

yup, it can be closed.

On Fri, Nov 8, 2019 at 12:04 PM betaboon notifications@github.com wrote:

@ryanrhee https://github.com/ryanrhee i currently do not see any reason for the prefix changing. though it can obviously not be ruled out ;)

can this issue be closed ?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/eendroroy/alien/issues/28?email_source=notifications&email_token=AAB3G5EOU2GI4M2B5X3BZ4LQSWL2VA5CNFSM4JAQPIU2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDSXTVI#issuecomment-551909845, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAB3G5CGBJRLE6FTPYI2273QSWL2VANCNFSM4JAQPIUQ .