twm - Tmux Workspace Manager
What is twm?
twm
is a project I’ve been working on to manage workspaces in tmux. It’s written in Rust, is easy to configure, very flexible, and pretty fast.
The GitHub repo is here if you want to check it out!
Motivation
Everything you probably need to know about twm
is in the README, but I’ll talk a little bit more about why I wanted to make it here.
I was originally inspired to start using something to manage my tmux sessions by ThePrimeagen’s tmux-sessionizer script. As Prime says in his own videos, tmux-sessionizer
was one of the best additions he made to his workflow due to the speed gains while zipping around different projects.
I used basically a copy paste of his script for a pretty long time, but I found myself wanting some extra functionality here and there. Can I automatically open certain panes or windows when I open a workspace? Things like that.
I briefly tried just adjusting his original scripts, but… they’re bash scripts. Even though I could I just didn’t want to deal with it after a shockingly short time. So I started looking into alternatives.
First I found tmuxinator. The configuration options in tmuxinator
covered everything I wanted to do - it felt pretty great opening up a project after a fresh reboot and having all the panes and windows I wanted set up. But one thing that started to really annoy me was the centralized configuration. If I wanted to configure a project, I had to create a new project file in ~/.config/tmuxinator/[project].yml
. This project has to be configured with a root directory. Blah blah. What if I want to clone a new repo and get going? It felt like too much friction. It also didn’t have fuzzy finding built-in, which was annoying. It was easy enough to fzf
through my projects, but why?
The next best thing I found was dmux. It did away with the annoying centralized configuration, and I didn’t have to use tmuxinator
’s custom configuration syntax. It felt easier to open up a new project and just get started. But with this still, I found configuration options lacking and some other features I’d wanted to add to twm
missing.
In my search for a better tmux manager I also found a Rust version of tmux-sessionizer with built-in support for git worktrees. The worktree integration was neat, and I like anything in Rust, but I didn’t personally like the way worktree support was implemented (each worktree in a window).
This led me to want to write twm
. If you want to read about what it actually does, just go to the README. I figure not everyone on the GitHub page needs to have all the thought process behind it, so that’s why I put it here and not there.
twm Workflow
I plan to make a longer post soon about how I use twm
in my own workflow along with the helper scripts that make my “fast af boiiiiiii” in the terminal.