From 82c1c73694981fe508381339abd4b556aa71d7a9 Mon Sep 17 00:00:00 2001 From: Ceda EI Date: Sun, 24 Feb 2019 16:37:16 +0530 Subject: [PATCH] Update Plugins --- Plugins.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Plugins.md b/Plugins.md index cad59f1..788f740 100644 --- a/Plugins.md +++ b/Plugins.md @@ -14,3 +14,16 @@ + [Tmux](plugins/tmux) + [Username](plugins/username) + [vcs](plugins/vcs) + +# How to create new plugin + +Themes need to define the following functions + +> Note: Replace `plugin_name` with actual plugin name + ++ `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. + +Check [dummy plugin](https://gitlab.com/ceda_ei/wish/blob/master/plugins/dummy.sh).