A tmux workspace manager
If you use tmux a lot, then you probably have a script that looks like this:
bash tmux new-window -n $WINDOW_NAME tmux split-window -h tmux select-pane -t 0 tmux send-keys "fish" C-m tmux send-keys "nvim" C-m tmux select-pane -t 1 tmux send-keys "fish" C-m tmux resize-pane -R 80 tmux -2 attach-session -t $SESSIONScripts like the one above set up and open a tmux session with specified commands and layout. But if I wanted to have another pane that ran my tests, or another for note taking, I'd have to create an entirely new script. I also wanted to be able to use some program like fzf or skim to pick a directory to open. This got super annoying.
Dmux aims to handle all of this for you. Its main job is to open up configurable "workspaces" in whatever directory you want. It also allows you to specify everything you would normally set in a script like the one above.
For example, the above script using dmux would be:
dmux -c nvim fishThen if I wanted the workspace to open 3 panes instead of two, I could add:
dmux -c nvim fish "npm i" -p 3
But say I wanted to use fzf to select a dir to open up. Well, if I have it installed on my system, then I just have to leave off the argument and dmux will automatically open an fzf selector, populated with directories to choose from.
If this part is a bit slow to get started, no worries, you can speed up the dir searching by installing fd.
You can also use whatever combination of dir searching, selector, or hardcoded path you want by piping a path into dmux:
fd -td | fzf | dmuxor having a path argument:
dmux
There's a ton of other fantastic projects out there that also do similar things that you should check out: * tmuxinator * tmuxomatic - Unmaintained * teamocil - Unmaintained
brew tap zdcthomas/tools brew install dmux
Or if you have rust installed
bash cargo install dmux
Coming soon
dmuxalone will use
fzfto open up a list of dirs in
~. This is equivalent to saying
fd -td . ~/ | fzf | dmux
dmuxor
| dmuxwill open the workspace in the provided path
dmux clonewill clone a git repo and open the repo in a workspace
dmux layoutwill describe the current Tmux layout. This uses the tmux layout representation
dmux --helpfor more information
Dmux's configuration tries to be very inclusive in terms of config file types. Dmux supports
JSON, YAML, TOML,and
HJSON. It also supports a variety of paths including
~/.dmux.conf.{file_type}
~/.config/dmux/dmux.conf.{file_type}and on Linux
$XDG_CONFIG_HOME/dmux/dmux.conf.{file_type}
This config file has a profile named
javascriptand defaults set
layout = "5e09,281x67,0,0{133x67,0,0,17,147x67,134,0[147x33,134,0,18,147x33,134,34{73x33,134,34,136,73x33,208,34[73x16,208,34,164,73x16,208,51,165]}]}" session_name = "development" number_of_panes = 5 commands = ["nvim", "fish"][javascript] number_of_panes = 3 session_name = "frontend" commands = ["nvim", "fish", "yarn watch"]
Currently dmux relies on fzf to select a target dir to open the workspace in. If you have fd installed dmux will use it to speed up dir searching.
npm ior
mix deps.get