Skip to content
/ zj-dim Public

A plugin for the zellij terminal multiplexer. Conditionally dims theme components on mode changes, and dims theme components for panes out of focus.

License

Notifications You must be signed in to change notification settings

MetaGG2/zj-dim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zj-dim

Visually indicates state through color.

A zellij plugin that automatically reduces the brightness of your theme:

  • ...when Zellij is in any mode other than Locked (e.g. normal, pane, tab, etc...)
  • ...for panes not in focus

Demo

Contents

Why Would I Want This?

If you:

  • ...want visual information to indicate active pane and mode
  • ...need extra eyecandy to look at your terminal
  • ...can't be bothered to set the frame_unselected property yourself

...then maybe you'd want this plugin.

Note

Zellij by default supports the frame_unselected property, so you can manually change it within your theme. The dim_unfocused_panes option in this plugin just configures the frame_unselected property for you, using your existing theme colors, as the property is not used in any built-in themes.

Installation

Either define it as an alias:

plugins {
    zj-dim location="https://github.com/MetaGG2/zj-dim/releases/latest/download/zj_dim.wasm" {
        // config options here...
    }
}

load_plugins {
    zj-dim
}

...or without one:

load_plugins {
    plugin location="https://github.com/MetaGG2/zj-dim/releases/latest/download/zj_dim.wasm" {
        // config options here...
    }
}

Configuration

The following configuration was used for the demo.

zj-dim {
    // positive decimal that serves as a multiplier for the current theme colors
    // multiplier active when not in "LOCKED" mode
    // set to "1.0" to disable
    dim_when_unlocked "0.5"

    // positive decimal that serves as a multiplier for the current theme colors
    // multiplier applies for "frame_unselected" style definition (basically panes not in focus)
    // set to "1.0" to disable
    dim_unfocused_panes "0.6"

    // space-separated list of style definitions to ignore
    // NOTE: only applies to the `dim_when_unlocked` setting
    // list of style definitions:
    //   text_unselected text_selected ribbon_unselected ribbon_selected
    //   table_title table_cell_unselected table_cell_selected list_unselected
    //   list_selected frame_unselected frame_selected frame_highlight
    //   exit_code_success exit_code_error multiplayer_user_colors
    styles_ignored "frame_highlight ribbon_selected"
}

Technicalities / Limitations

The plugin works through dynamically calculating individual themes for each combination of settings. This means:

  • ℹ️ All colors calculated are based off of your current theme colors
  • ℹ️ Each "dimmed" theme is defined as a new theme (e.g. dim_user, dim_unlocked, dim_unfocused, dim_combined) and active theme is swapped at runtime on mode changes
  • ⚠️ Reloading your Zellij config will update existing sessions with the default shipped theme

About

A plugin for the zellij terminal multiplexer. Conditionally dims theme components on mode changes, and dims theme components for panes out of focus.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages