oh-my-bash icon indicating copy to clipboard operation
oh-my-bash copied to clipboard

modular enablement and disablement

Open jasonnet opened this issue 4 years ago • 2 comments

For solutions like cron we have directories like cron.d that lists the enabled facilities. Other utilities have similar .d directories they check. This helps other facilities leverage the capabilities of the utility without having to safely parse out a configuration file to add or remove themselves from it.

I know OMB has a plugins directory, but that doesn't seem related to enablement. That seems to just be a palette of things that can be enabled from elsewhere.

Does OMB have something like a .d directory? If not, is it something considered and we just need a pull request?

Edit: I am referring to something like the following, but already a part of OMB: https://github.com/jdcapa/bashrc.d

jasonnet avatar Jun 29 '20 20:06 jasonnet

Hi @jasonnet,

Yes, OMB was designed to allow you to use your own plugins, themes, completions, aliases beside of the core one. By default, the custom directory put under .oh-my-bash/custom.

The path of custom folder is able to customised inside your .bashrc. (e.g ~/.oh-my-bash-custom)

The structure of custom (OSH_CUSTOM) directory will be the same as the current structure of OMB root.

If mean you can put your own plugin (example.plugin.sh) under OSH_CUSTOM/plugins/example, or your own alias as OSH_CUSTOM/aliases/example.aliases.sh.

After that, you can enable/disable your plugins, themes..etc in .bashrc.

Cheers, Toan

nntoan avatar Jun 30 '20 11:06 nntoan

Hi @nntoan.

Thanks for taking the time to answer.

I probably didn't explain myself clearly. I am familiar with the .oh-my-bash/custom directory, but as you said, unfortunately one still has to edit .bashrc to enable/disable a component there. My question+proposal is about a way to enable or disable, not install, features and customizations without editing .bashrc.

The approach it suggests is similar to that used by other facilities including the ones I mentioned. I'll add Apache to that list since I encountered this capability with Apache yesterday. The advantage that I see is that it makes it very easy for additional facilities to enable and disable themselves by adding or removing files+directories instead of attempting to safely edit the .bashrc file which is already used for purposes in addition to OMB. It's a safe one liner for those facilities and it's seems like an easy feature to add to OMB.

If the team agrees that this is something the community would appreciate, I'd be happy to provide a pull request.

jasonnet avatar Jul 02 '20 06:07 jasonnet