Clarify creating a custom module (#164)

* Clarify creating a custom module

* Fix path

Co-authored-by: Hamothy <58985301+sgoudham@users.noreply.github.com>

* Fix formatting and mention required plugins

* docs: indentation & small tweaks

---------

Co-authored-by: Hamothy <58985301+sgoudham@users.noreply.github.com>
Co-authored-by: sgoudham <sgoudham@gmail.com>
This commit is contained in:
qadzek 2024-03-17 16:41:20 +01:00 committed by GitHub
parent 4eb10fa510
commit 2a3bc9ea91
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 75 additions and 40 deletions

View file

@ -1,10 +1,16 @@
show_example() {
local index=$1
local icon="$(get_tmux_option "@catppuccin_test_icon" "󰙨")"
local color="$(get_tmux_option "@catppuccin_test_color" "$thm_blue")"
local text="$(get_tmux_option "@catppuccin_test_text" "It works!")"
# If this module depends on an external Tmux plugin, say so in a comment.
# E.g.: Requires https://github.com/aaronpowell/tmux-weather
local module=$( build_status_module "$index" "$icon" "$color" "$text" )
show_test() { # This function name must match the module name!
local index icon color text module
index=$1 # This variable is used internally by the module loader in order to know the position of this module
icon="$( get_tmux_option "@catppuccin_test_icon" "" )"
color="$( get_tmux_option "@catppuccin_test_color" "$thm_orange" )"
text="$( get_tmux_option "@catppuccin_test_text" "hello world" )"
module=$( build_status_module "$index" "$icon" "$color" "$text" )
echo "$module"
}