mirror of https://gitlab.com/ceda_ei/wish
Update Plugins
parent
aa471cdcc5
commit
82c1c73694
13
Plugins.md
13
Plugins.md
|
@ -14,3 +14,16 @@
|
||||||
+ [Tmux](plugins/tmux)
|
+ [Tmux](plugins/tmux)
|
||||||
+ [Username](plugins/username)
|
+ [Username](plugins/username)
|
||||||
+ [vcs](plugins/vcs)
|
+ [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).
|
||||||
|
|
Loading…
Reference in New Issue