Skip to main content

A declarative tmux session manager

Project description

gremux

Static Badge Static Badge

A declarative tmux session manager.

[!NOTE] This project is very early in development. Only a few features are implemented, and there is a long roadmap to cover. If you have any feature requests, leave an issue.

gremux automates the process of launching a tmux session exactly how you want it in a declarative way. That is, given a static configuration file grem.yaml, gremux will parse it and attach you to a session that matches that setup.

This project started when I got tired of having to manually set up my tmux panes and windows each time I rebooted my laptop. Thus, I can spend many hours automating a process that takes literal seconds.

Here is a list of a few similar projects:

  • tmuxp: Session manager for tmux, build on libtmux.
  • tmuxinator: Manage complex tmux sessions easily
  • disconnected: Simple tmux session creator

Why choose gremux?

You don't have to if you don't want. That's the beauty of FOSS. This project was started as something to kill the time while waiting for my experiments during my PhD. I use it as my main tool, and it would be amazing if other people found it useful.

Additionally, I do projects in order to teach myself some design patterns to eventually be a better programmer. I don't mind reinventing the wheel from time to time in order to learn something new.

[!NOTE] The name gremux. I am obsessed with VTubers, and put references everywhere I can. This is a reference to Gigi Murin, whose fanbase are called grems.

Features

  • Declarative YAML tmux session configuration in a per-project basis
  • tmux-sessionizer, inspired by ThePrimeagen's script.

For a list of TODOs, see the roadmap

Installation

This project is in very early stages of development, there is no proper way for installation other than a local python package.

  1. Create a (global) virtual environment where your shell defaults into.
  2. Install the repository with pip
pip install gremux
  1. Install fzf from your package manager.

Run gremux to open the sessionizer.

Setup

Common places

You must create the (global config) file ~/.config/gremux/places.yaml. To create it, run

gremux places create --source default

This will create a basic places.yaml with your home directory. To add more places, you can manually edit the file or run

gremux places create --add dir1 dir2 dir3

[!TIP] If you use zoxide, then you can choose to use the database as a source

gremux places create --source zoxide

And optionally you can add the --maximum N flag to only add the first $N$ elements from the database.

Here is an example of how it should look like.

places:
  - "~"
  - "~/Documents/"
  - "~/Documents/mnt/"
  - "~/Documents/phd/"
  - "~/Documents/projects/"

which is intended to be the list of the common places you visit in your system. This information is used by the sessionizer to know where to look

Configuration file

tmux sessions are launched by parsing a configuration file called grem.yaml that is intended to be placed on your project's root. If no file is found, it will default to a single window-pane setup.

See the templates directory for some examples. Here are a few notes of the keywords

session

  • name: the name of the session
  • windows: list of windows to open

windows

  • name: the name of the window
  • layout: layout to use. Must match tmux window layouts or null to do nothing.
  • panes: list of panes to split

panes

  • cwd: Working directory for the pane. Assumed to be relative to the project's root.
  • command: list of commands to execute in the current pane. They are executed sequentially.

Usage

There are two basic ways to launch a session

  1. Run gremux, type your project's directory and hit <enter>. This will use the project's grem.yaml if available, otherwise, it will default to a generic one window/panel default.
  2. If you are alredy somewhere, run
gremux config up --source /path/to/grem.yaml

if no --source is provided, it defaults to pwd

Other useful commands

  • To see the configuration that is going to be used, run
gremux config show
  • To create the default configuration under ~/.config/gremux/default.yaml
gremux config create --source default

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gremux-0.1.0.tar.gz (19.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gremux-0.1.0-py3-none-any.whl (19.8 kB view details)

Uploaded Python 3

File details

Details for the file gremux-0.1.0.tar.gz.

File metadata

  • Download URL: gremux-0.1.0.tar.gz
  • Upload date:
  • Size: 19.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for gremux-0.1.0.tar.gz
Algorithm Hash digest
SHA256 22c41431774fda22ee23c6fa7d74594e715e78b99c30ccc54f2d69707e413a7b
MD5 20e514aaae20aaa6497d4026e11c0f2e
BLAKE2b-256 5166f339af2689273aff4c194c16ad435d9abb22e6e7c8fe8147ab1bcbe3fce7

See more details on using hashes here.

File details

Details for the file gremux-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: gremux-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 19.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for gremux-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2523169dcdb3f3b7bfb7c99a65509835cf79aef9c274dce20dd8e7edffdc0f04
MD5 a5fe9f1803df035f19063a4031f863d8
BLAKE2b-256 e1401095d2befcd7b88a4a9058425b228de6988c0b69772a2b360ce6bfab7743

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page