aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Jankowski <daniel.jankowski@rub.de>2024-03-02 12:16:46 +0100
committerDaniel Jankowski <daniel.jankowski@rub.de>2024-03-02 12:16:46 +0100
commit08aac79c6152be5fac2d6edda67436fab8711ddc (patch)
treece27036c1bd6dd5c2702beefd6157505496f4d45
parentchore: fix code highlightning in README (diff)
downloadsl0pstatus-08aac79c6152be5fac2d6edda67436fab8711ddc.tar.gz
sl0pstatus-08aac79c6152be5fac2d6edda67436fab8711ddc.tar.xz
sl0pstatus-08aac79c6152be5fac2d6edda67436fab8711ddc.zip
chore: refer to wiki
-rw-r--r--README.md251
1 files changed, 37 insertions, 214 deletions
diff --git a/README.md b/README.md
index ecdbd1b..f14ffef 100644
--- a/README.md
+++ b/README.md
@@ -47,6 +47,9 @@
## ๐Ÿš€ Installation
+> [!TIP]
+> For more detailed instructions, check out the [wiki](https://github.com/dj95/zjstatus/wiki/1-%E2%80%90-Installation)!
+
Download the latest binary in the github releases. Place it somewhere, zellij is able to access it. Then the
plugin can be included by referencing it in a layout file, e.g. the default layout one.
@@ -54,7 +57,8 @@ You could also refer to the plugin guide from zellij, after downloading the bina
Please ensure, that the configuration is correct.
-โš ๏ธ **In case you experience any crashes or issues, please in the first step try to clear the cache! (`$HOME/.cache/zellij/` for Linux, `$HOME/Library/Caches/org.Zellij-Contributors.Zellij/` on macOS)**
+> ![!IMPORTANT]
+> In case you experience any crashes or issues, please in the first step try to clear the cache! (`$HOME/.cache/zellij/` for Linux, `$HOME/Library/Caches/org.Zellij-Contributors.Zellij/` on macOS)
Sometimes, especially when updating zjstatus, it might come to caching issues, which can be resolved by clearing it. Please keep in
mind, that it will also clear the cache for running sessions and revokes granted permissions for plugins.
@@ -90,233 +94,52 @@ config file, you can use `${pkgs.zjstatus}/bin/zjstatus.wasm` as the path.
## โš™๏ธ Configuration
-Configuration can be performed in the layout file, when importing the plugin. Here's a short example.
+For configuring zjstatue, please follow the [documentation](https://github.com/dj95/zjstatus/wiki/2-%E2%80%90-Configuration).
+
+## ๐Ÿงฑ Widgets
+
+The documentation for the widgets can be found in the [wiki](https://github.com/dj95/zjstatus/wiki/3-%E2%80%90-Widgets).
+
+## ๐Ÿงช Example configuration
```javascript
layout {
- pane split_direction="vertical" {
- pane
- }
-
- pane size=1 borderless=true {
- plugin location="file:target/wasm32-wasi/debug/zjstatus.wasm" {
- format_left "{mode} #[fg=#89B4FA,bold]{session}"
- format_center "{tabs}"
- format_right "{command_git_branch} {datetime}"
- format_space ""
+ default_tab_template {
+ children
+ pane size=1 borderless=true {
+ plugin location="https://github.com/dj95/zjstatus/releases/latest/download/zjstatus.wasm" {
+ format_left "{mode} #[fg=#89B4FA,bold]{session}"
+ format_center "{tabs}"
+ format_right "{command_git_branch} {datetime}"
+ format_space ""
- border_enabled "false"
- border_char "โ”€"
- border_format "#[fg=#6C7086]{char}"
- border_position "top"
+ border_enabled "false"
+ border_char "โ”€"
+ border_format "#[fg=#6C7086]{char}"
+ border_position "top"
- hide_frame_for_single_pane "true"
+ hide_frame_for_single_pane "true"
- mode_normal "#[bg=blue] "
- mode_tmux "#[bg=#ffc387] "
+ mode_normal "#[bg=blue] "
+ mode_tmux "#[bg=#ffc387] "
- tab_normal "#[fg=#6C7086] {name} "
- tab_active "#[fg=#9399B2,bold,italic] {name} "
+ tab_normal "#[fg=#6C7086] {name} "
+ tab_active "#[fg=#9399B2,bold,italic] {name} "
- command_git_branch_command "git rev-parse --abbrev-ref HEAD"
- command_git_branch_format "#[fg=blue] {stdout} "
- command_git_branch_interval "10"
- command_git_branch_rendermode "static"
+ command_git_branch_command "git rev-parse --abbrev-ref HEAD"
+ command_git_branch_format "#[fg=blue] {stdout} "
+ command_git_branch_interval "10"
+ command_git_branch_rendermode "static"
- datetime "#[fg=#6C7086,bold] {format} "
- datetime_format "%A, %d %b %Y %H:%M"
- datetime_timezone "Europe/Berlin"
+ datetime "#[fg=#6C7086,bold] {format} "
+ datetime_format "%A, %d %b %Y %H:%M"
+ datetime_timezone "Europe/Berlin"
+ }
}
}
}
```
-In order to start using zjstatus you need to specify the widgets you'd like to use under the `format_left` and/or `format_center` and/or `format_right`
-configuration. Formatting can be done with `#[..]`, while widgets and properties are surrounded by `{..}`.
-The blank space between the left and the right part can be colored with `format_space`.
-
-### ๐Ÿ”ง General configuration
-
-This section describes some general configuration for zjstatus.
-
-#### Hide pane frames for tabs single panes
-
-The option `hide_frame_for_single_pane` will toggle the pane frames depending on how many panes (not plugin panes) are shown.
-This will effectively hide the frame border, when only one pane, like an editor, is shown. Pane frames are toggled as soon
-as there is another pane created.
-
-#### Border for the bar
-
-When hiding the pane frames, zjstatus might blend in too well with the background and opened panes since zellij won't draw
-the border for non-selectable plugins. Therefore zjstatus provides its own border, that can be activated and customized.
-Most important, the pane height for the plugin **must be set to 2**. Otherwise zjstatus won't be able to draw it. For top
-bar configurations the position of the border is also implemented.
-
-```javascript
-border_enabled "true" // "true" | "false" for activating the bar
-border_char "โ”€" // character used for drawing the bar
-border_format "#[fg=#6C7086]" // format specifier for theming
-border_position "top" // "top" | "bottom" for the border position relative to the bar
-```
-
-### ๐ŸŽจ Formatting and theming
-
-Text and modules can be themed with directives in `#[]`. These directives tell zjstatus to print the following
-text in the specified format. It will reset the format on any new directives or after rendering a widget.
-Options can be combined with a `,`, when they occur in the same bracket.
-
-Possible formatting options are:
-
-| name | value | example | description |
-|--------|---------------------------|---------------|------------------|
-| fg | hex or ansi color or name | `#[fg=#ffffff]` | foreground color |
-| bg | hex or ansi color or name | `#[bg=#ffffff]` | background color |
-| bold | none | `#[bold]` | bold text |
-| italic | none | `#[italic]` | italic text |
-
-Colors can be specified either by giving the hexadecimal rgb value or the ansi color (0..255). To simplify the specification
-by ansi color codes, the color name can also be used. They refer to the configured color in the terminal.
-
-### ๐Ÿงฑ Widgets
-
-zjstatus contains the following widgets with their respective config.
-
-#### command
-
-**Handle** `{command_NAME}`
-
-โš ๏ธ zellij 0.39.0 or newer is needed!
-
-This widget is able to run arbitrary commands and prints the result. Keep in mind, that it
-runs **just** the command **not** in a shell. If you'd like to use a shell, please make
-sure you specify it and properly use it for running your command. Since the command widget
-should be able to run multiple commands, it behaves a bit different than the other widgets.
-Therefore the command need to have a name in form of e.g. `{command_pwd}` or `{command_git_branch}`. The following
-options can be provided per named command.
-
-```javascript
-// the command that should be executed
-command_NAME_command "bash -c \"pwd | base64\""
-
-// themeing and format of the command
-command_NAME_format "#[fg=blue, bg=black] {exit_code} {stdout} {stderr}"
-
-// interval in seconds, between two command runs
-command_NAME_interval "1"
-
-// render mode of the command. ["static", "dynamic", "raw"]
-//
-// "static" :: format the command with the given format from the config and don't
-// consider any other formatting directives
-// "dynamic" :: format the command based on the command output. When the command
-// output contains formatting strings for zjstatus, zjstatus will
-// try to render them. This might lead to unexpected behavior, in case
-// the formatting is not correct.
-// "raw" :: do not apply any formatting. This can be used to properly render
-// ansi escape sequences from the command output.
-command_NAME_rendermode "static"
-```
-
-#### datetime
-
-**Handle** `{datetime}`
-
-Print the date and/or time by the given format string. Due to the WASM sandbox
-the timezone cannot be determined from the system. You can configure it
-with the `datetime_timezone` parameter. Choose the according string from the
-chrono documentation: [https://docs.rs/chrono-tz/latest/chrono_tz/enum.Tz.html](https://docs.rs/chrono-tz/latest/chrono_tz/enum.Tz.html).
-For the `datetime_format` syntax, you can also check the specifiers table
-available in the chrono documentation:
-[https://docs.rs/chrono/latest/chrono/format/strftime/index.html](https://docs.rs/chrono/latest/chrono/format/strftime/index.html).
-
-```javascript
-// theme formatting for colors. Datetime output is printed in {format}.
-datetime "#[fg=#6C7086,bold] {format} "
-
-// format of the date
-datetime_format "%A, %d %b %Y %H:%M"
-
-// timezone to print
-datetime_timezone "Europe/Berlin"
-```
-
-#### mode
-
-**Handle** `{mode}`
-
-Indicate the current active mode in zellij. Each mode can be configured individually. If a mode is not configured, it will
-fall back to the format of `mode_normal`, if `mode_default_to_mode` is not specified or invalid. Otherwise it will use the
-format referenced in `mode_default_to_mode`, if the format for a mode is unspecified. The name of the mode can be used
-in the `{name}` variable.
-
-```javascript
-mode_normal "#[bg=#89B4FA] {name} "
-mode_locked "#[bg=#89B4FA] {name} "
-mode_resize "#[bg=#89B4FA] {name} "
-mode_pane "#[bg=#89B4FA] {name} "
-mode_tab "#[bg=#89B4FA] {name} "
-mode_scroll "#[bg=#89B4FA] {name} "
-mode_enter_search "#[bg=#89B4FA] {name} "
-mode_search "#[bg=#89B4FA] {name} "
-mode_rename_tab "#[bg=#89B4FA] {name} "
-mode_rename_pane "#[bg=#89B4FA] {name} "
-mode_session "#[bg=#89B4FA] {name} "
-mode_move "#[bg=#89B4FA] {name} "
-mode_prompt "#[bg=#89B4FA] {name} "
-mode_tmux "#[bg=#ffc387] {name} "
-
-mode_default_to_mode "tmux"
-```
-
-#### session
-
-**Handle** `{session}`
-
-Print the current session name. This module cannot be configured. For formatting, please put the Formatting
-sequence right before the handle in `format_left`, `format_center` or `format_right`.
-
-#### swap layout
-
-**Handle** `{swap_layout}`
-**Click behavior** Switch to the next swap layout
-
-Print the active swap layout. This module cannot be configured. For formatting, please put the Formatting
-sequence right before the handle in `format_left`, `format_center` or `format_right`.
-
-#### tabs
-
-**Handle** `{tabs}`
-**Click behavior** Navigate to the tab that got clicked
-
-Print a list of current tabs. The name of the tab can be used with `{name}` in the config. The active tab will
-default to the normal formatting, if not configured.
-With `{index}` the tab position can also be used. With `{floating_total_count}` you can print the total amount
-of floating panes.
-In addition to separate formats for sync and fullscreen tabs, you can use `{sync_indicator}`,
-`{fullscreen_indicator}` and `{floating_indicator}` in each format. It will be replaced with the respective
-configuration from `tab_sync_indicator` and so on. Please be aware, that the indicators are only replaced
-when they are configured.
-
-```javascript
-// formatting for inactive tabs
-tab_normal "#[fg=#6C7086] {index} :: {name} "
-tab_normal_fullscreen "#[fg=#6C7086] {index} :: {name} [] "
-tab_normal_sync "#[fg=#6C7086] {index} :: {name} <> "
-
-// formatting for the current active tab
-tab_active "#[fg=#9399B2,bold,italic] {name} {floating_indicator}"
-tab_active_fullscreen "#[fg=#9399B2,bold,italic] {name} {fullscreen_indicator}"
-tab_active_sync "#[fg=#9399B2,bold,italic] {name} {sync_indicator}"
-
-// separator between the tabs
-tab_separator "#[fg=#6C7086,bg=#181825] | "
-
-// indicators
-tab_sync_indicator "<> "
-tab_fullscreen_indicator "[] "
-tab_floating_indicator "โฌš "
-```
-
## ๐Ÿšง Development
Make sure you have rust and the `wasm32-wasi` target installed. If using nix, you could utilize the nix-shell