Proof of Concept - tested for tmux >= 2.1
tmux-sidebar-plus
is a fast and customizable multi-window
tmux sidebar.
An enhanced fork of tmux-sidebar,
the system information sidebar is available through the command prefix-b
by default.
tmux-sidebar-plus
adds the following features to tmux-sidebar
:
- multi-pane sidebar
Allows for multiple panes in a variety of layouts. - practical default layouts
Including system monitoring, git tracking - easily-customizable commands
Create simple configuration files to manually determine the layout of the sidebar - layout selection
Select from a variety of default layouts, or a custom layout, using the layout selector key (default prefix+g)
Clone the repo:
$ git clone https://github.com/addisonlynch/tmux-sidebar-plus ~/clone/path
Add this line to the bottom of .tmux.conf
:
$ run-shell ~/clone/path/sidebar-plus.tmux
Reload tmux environment
$ tmux source-file ~/.tmux.conf
option | default | description |
---|---|---|
@sidebar-plus-sidebar-key |
b | Set sidebar toggle key |
@sidebar-plus-layout-key |
g | Set layout selection key |
@sidebar-plus-layout-dir |
none | Additional layouts directory |
@sidebar-plus-position |
left | Desired sidebar position (left or right) |
Open and close the sidebar using prefix-b.
Select your desired layout using prefix-g.
A number of useful layouts are provided by tmux-sidebar-plus
, including:
To add custom layouts, create a directory and set its absolute path to
@sidebar-plus-layout-dir
.
The layout file should be named as desired and follow the below format:
LAYOUT_NAME="git"
PANES=3
MINIMUM_WIDTH="50"
populate_sidebar(){
local sidebar_id="$1"
tmux select-pane -t "$sidebar_id"
tmux resize-pane -t "$sidebar_id" -x "${MINIMUM_WIDTH}"
# Build & register panes
local pane_1_id="$(split "${sidebar_id}" "vertical")"
register_pane $sidebar_id $pane_1_id
# Run panes' commands
watched_dir_command $sidebar_id "git status"
watched_dir_command $pane_1_id "git log --all --decorate --oneline --graph"
select_base_pane
}
Where MINIMUM_WIDTH
is the minimum width of the parent pane required to
open the sidebar.
It is possible to override the default layouts by specifying a custom layout of
the same name. tmux-sidebar-plus
will then use the custom layout's
configuration file.
The update_dir.sh
script runs a command every 3 seconds. This can be
included in any custom layout.
- Enhanced layout caching (by pane, window, and session)
- Expanded default layouts (pull requests welcome)
tmux-sidebar-plus is an adapted implementation of tmux-sidebar written by Bruno Sutic.
Email: [email protected] Twitter: alynchfc
Copyright © 2019 Addison Lynch
See LICENSE for details