This project aims to be a successor to tmuxinator, which allows users to define tmux project profiles (e.g. open two windows, split each into three panes and run a series of commands in each). It is written in Rust and will be more dependable (config is typechecked where possible) and simpler to install. It's also a great excuse for me to learn more about Rust, its ecosystem and compiling/distributing binaries for various platforms.
cargo build && ./target/debug/rmuxinator start Example.toml
Projects are defined using toml.
For example: ``` layout = "main-horizontal" name = "example" panenameuseroption = "custompanetitle" startdirectory = "/home/peter/projects/vim"
[[hooks]] command = "run-shell \"tmux display-message 'Hi from pane-focus-in hook!'\"" name = "pane-focus-in"
[[windows]] layout = "tiled" name = "one" start_directory = "/home/peter/projects/sample-project"
[[windows.panes]] commands = ["echo pane-one"] name = "Work"
[[windows.panes]] commands = ["echo pane-two"] name = "Music" start_directory = "/home/peter/projects/rmuxinator/src"
[[windows.panes]] commands = ["echo pane-three"] name = "RSS"
[[windows.panes]] commands = ["echo hi one", "echo intermediate one", "echo bye one"]
[[windows]] name = "two" start_directory = "/home/peter/projects/sample-project"
[[windows.panes]] commands = ["echo pane-one"]
[[windows.panes]] commands = ["echo pane-two"] start_directory = "/home/peter/projects/rmuxinator/src"
[[windows.panes]] commands = ["echo pane-three"]
[[windows.panes]] commands = ["echo hi one", "echo intermediate one", "echo bye one"] ```
Optional attributes will be noted below.
name
(string)windows
(array; see dedicated entry)hooks
(array; see dedicated entry)layout
(string; preset tmux layouts: "even-horizontal", "even-vertical", "main-horizontal", "main-vertical", "tiled")pane_name_user_option
(string; must have matching entry in .tmux.conf (e.g. set -g pane-border-format "#{@custom_pane_title}"
)start_directory
(string)command
(string; must use tmux's run_shell
; see tmux docs)name
(string; must match existing tmux hook (e.g. after-select-pane
); see tmux docs)panes
(array; see dedicated entry)layout
(string; preset tmux layouts: "even-horizontal", "even-vertical", "main-horizontal", "main-vertical", "tiled")name
(string)start_directory
(string)commands
(array of strings)name
(string)start_directory
(string)debug
Print the tmux commands that would be used to start and configure a tmux
session using a path to a project config file:
rmuxinator debug Example.toml
start
Start a tmux session using a path to a project config file:
rmuxinator start Example.toml
rmuxinator currently assumes that both base-index
and pane-base-index
are
0. This will be handled programatically in a future release, but for the time
being, it can be worked around by either removing overrides from .tmux.conf or
by adding the following:
set -g base-index 0
set -g pane-base-index 0
This project is currently a proof of concept and I'll be duplicating tmuxinator features and adding additional improvements as I can find time. Right now, it's capable of: - parsing a TOML project config file - starting a named tmux session - setting a default layout for project windows - setting the default working directory - creating windows - setting cwd for windows - setting window layout - creating panes - setting cwd for panes - setting a pane title using a "user option" (requires >= tmux 3.0a and related pane-border-format config option) - running pane commands - wiring up optional tmux event hooks/callbacks
tmux kill-window
was failing silentlyHere are the platforms rmuxinator is known to work on: - x8664 GNU/Linux - x8664 GNU/Linux (Windows Subshell) - armv6l GNU/Linux (RPi Zero; I was able to successfully cross-compile from Debian x86_64 => armv6l using the arm-linux-gnueabihf linker provided in the raspberrypi/tools repository. The Debian package did not work; I was able to compile successfully, but the program segfaulted immediately when executed.)