Sessionizer is a tool to search through your projects and create custom tmux sessions for each project.
Sessionizer has the following features:
- Search through your projects and create custom tmux sessions for each project.
- Keep track of the most used projects and order them accordingly.
- Supports per-project configuration files.
You can install Sessionizer by running the following command:
go install github.com/salfel/sessionizer@latestBecause Sessionizer uses fzf to select the project, you will have to install fzf through your package manager.
If you are using NixOS or Home-Manager, you can include the sessionizer flake as a input of your configuration and add the binary to you packages like so:
{
inputs = {
sessionizer.url = "github:salfel/sessionizer";
sessionizer.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { self, sessionizer, ...environment.systemPackages = [
inputs.sessionizer.packages.${system}.default
];To get started, you need to create the configuration file at ~/.config/sessionizer/config.toml.
Below is an example configuration file:
search_paths = ["/home/felix/Projects"]
max_depth = 2 # Optional, defaults to 2
[session]
active = "Terminal"
[[session.windows]]
name = "Editor"
cmd = "nvim"
[[session.windows]]
name = "Git"
cmd = "lazygit"
[[session.windows]]
name = "Terminal"
path = "test"The configuration file is divided into two sections:
search_paths: A list of paths to search for projects.max_depth: The maximum depth to search for projects.session: The configuration for the session, global configuration can be overriden by local config. The session prefix has to be omitted if used in a local configuration file.active: The name of the window to activate after starting the session. If not specified, the first window will be activated.windows: A list of windows to create for each project.name: The name of the window.path: The path to the directory to start the window in.cmd: A list of commands to run in the window.
You can also add a sessionizer.toml file to the project directory to override the global configuration.
That configuration however, does not contain the search_paths field as this is a global option.
To start a session, run the following command:
sessionizerThis will open a fzf window listing all directories containing a git repository inside them.
When selecting a directory, it will check if the directory contains a sessionizer.toml file. If it does, it will override the global window configuration with the local one.
It will then launch a tmux session, set its name to the name of the directory selected with the specified windows and will focus the first window.
If a tmux session with the same name already exists, it will switch to that session.