Home

Awesome

Moxide

Moxide is a powerful tmux session manager written in Rust that simplifies the process of creating and managing complex tmux sessions. It allows you to define and control multiple windows and commands effortlessly, making it a perfect fit for developers and teams alike.

Features

Installation

To install Moxide, use the following command:

cargo install moxide

Why moxide

Moxide offers a unique combination of features:

Here are some scenarios how moxide might help people:

Configuration Files

Moxide uses simple YAML configuration files. Below are examples of how to configure directories, projects, and templates.

Example Configuration Files

Directories

~/.config/moxide/directories.yaml

- name: "Downloads"
  path: "~/Downloads/"
- name: "Home"
  path: "~/"

Projects

~/.config/moxide/projects/Moxide.yaml

name: Moxide

root_dir: ~/SoftwareDevelopment/cli/moxide/
template: Rust

It is also possible to have project specific configs.

Templates

~/.config/template/Rust.yaml

name: Rust

windows:
  - name: Neovim
    panes:
      - nvim
  - name: Cargo
    layout: even-horizontal
    panes:
      - cargo build
      - cargo clippy

Usage

Moxide allows you to choose whether to apply a template to a project or define the windows and commands per project. This flexibility enables teams to maintain standard setups while accommodating unique project needs.

Launching Moxide Sessions

moxide project start ProjectName
moxide template start Rust --directory ~
moxide dir start Downloads
moxide dir start "~/Pictures/"

Scripting integration

Moxide can be easily integrated into shell scripts. Below is a sample script for launching Moxide sessions with a selection tool:

#!/bin/bash

project_emoji="🚀"
template_emoji="🛠️"
directory_emoji="📁"

list=$(moxide list \
    --format-project "$project_emoji {}"\
    --format-template "$template_emoji {}"\
    --format-directory "$directory_emoji {}"
)

value=$(echo "$list" | \
    fzf \
    --no-sort \
    --layout reverse \
    --border rounded \
    --border-label "Moxide Sessions" \
    --no-scrollbar \
    --prompt "✨ " \
    --pointer "👉" \
    --color=bg+:#313244,bg:#1e1e2e,spinner:#f5e0dc,hl:#f38ba8 \
    --color=fg:#cdd6f4,header:#f38ba8,info:#cba6f7,pointer:#f5e0dc \
    --color=marker:#b4befe,fg+:#cdd6f4,prompt:#cba6f7,hl+:#f38ba8 \
    --color=selected-bg:#45475a
)

emoji="${value:0:1}"
name="${value:2}"

case "$emoji" in
    $project_emoji)
        moxide project start "$name"
        ;;
    $template_emoji)
        moxide template start "$name"
        ;;
    $directory_emoji)
        moxide dir start "$name"
        ;;
esac

You can bind this script into a tmux popup with the following command:

bind-key s display-popup -B -E -w 40% -h 12 "~/Dotfiles/scripts/shell/moxide.sh"

Similar Projects

If you are exploring alternatives, you might find these similar tools useful: