Update Plugins.md for new config file.

Ceda EI 2020-01-19 15:53:43 +05:30
parent 34657cecdc
commit 64bea8743f
1 changed files with 6 additions and 6 deletions

@ -17,13 +17,13 @@
# How to create new plugin
Themes need to define the following functions
> Note: Replace `pluginname` with actual plugin name
> Note: Replace `plugin_name` with actual plugin name
Plugins need to be defined in a file named `pluginname.sh`. Plugins are sourced from `$XDG_CONFIG_HOME/wish/plugins`, `/usr/share/wish/plugins` and `$HOME/.config/wish/plugins`. All keys from config are set as environment variables of the form `WISH_PLUGINNAME_KEY`. The following functions need to be defined in `pluginname.sh`.
+ `wish_plugin_name_set_colors` - This function is called after the theme. This allows the plugin to override the theme or set defaults if the theme has not themed some elements of the plugin. Although plugins are allowed to override themes, it is not recommended.
+ `wish_plugin_name_start` - This function should return 0 or 1 if it allows/disallows powerline before it respectively.
+ `wish_plugin_name_end` - This function should return 0 or 1 if it allows/disallows powerline before it respectively.
+ `wish_plugin_name_main` - This function is called every time a prompt is generated. Ensure to run `wish_append bg_color fg_color text` within this function. Although the plugin can override the theme while running `wish_append`, it is not recommended.
+ `wish_pluginname_set_colors` - This function is called after the theme. This allows the plugin to override the theme or set defaults if the theme has not themed some elements of the plugin. Although plugins are allowed to override themes, it is not recommended.
+ `wish_pluginname_start` - This function should return 0 or 1 if it allows/disallows powerline before it respectively.
+ `wish_pluginname_end` - This function should return 0 or 1 if it allows/disallows powerline before it respectively.
+ `wish_pluginname_main` - This function is called every time a prompt is generated. Ensure to run `wish_append bg_color fg_color text` within this function. Although the plugin can override the theme while running `wish_append`, it is not recommended.
Check [dummy plugin](https://gitlab.com/ceda_ei/wish/blob/master/plugins/dummy.sh).