Skip to main content

A CLI utility for tmux

Project description

txm - A Tmux Helper Tool

txm is a command-line utility to make working with tmux more efficient and user-friendly. It's written in Python and aims to abstract some of the complexities involved in managing tmux sessions, panes, and command executions.

Table of Contents

Installation

To install txm, navigate to the root directory of the project and execute the following command:

pip install .

This will build the package and install it. Also the package is temporarily available on pypitest (to move it later to pypi)

pip install -i https://test.pypi.org/simple/ txm

Usage

Here are the available functionalities of txm.

Session Management

Create a New Session

To create a new session, run:

txm new [SESSION_NAME]

List All Sessions

To list all available sessions, run:

txm list

Attach to a Session

To attach to an existing session, run:

txm attach [SESSION_NAME]

Detach from a Session

To detach from the current session, run:

txm detach

Pane Management

Split Pane Vertically

To split the current pane vertically, run:

txm vsplit

Split Pane Horizontally

To split the current pane horizontally, run:

txm hsplit

Navigate Between Panes

To navigate between panes, run:

txm navigate [DIRECTION]

DIRECTION can be one of the following: U for up, D for down, L for left, R for right.

Command Execution

Execute a Command

To execute a command in the current pane, run:

txm run [COMMAND]

Configuration

txm can optionally read from a .txm-config.json file located in the root directory for user-specific settings.

.txm-config.json

This configuration file contains settings and preferences for your TXM utility. It should be placed in the root directory of your project or your home directory.

Default Template:

{
  "tmux_path": "/usr/local/bin/tmux",
  "log_directory": "logs/",
  "default_session_name": "my_session"
}
  • tmux_path: Specifies the path to the tmux executable.
  • log_directory: Specifies the directory where tmux pane logs will be saved.
  • default_session_name: Specifies the default name for a new tmux session.

.txm-presets.json

This file holds the saved tmux session presets. It will be automatically generated by the txm save command, or you can create it manually in the directory of your choice.

Default Template:

{
  "presets": [
    {
      "name": "preset_1",
      "windows": [
        {
          "name": "window_1",
          "panes": ["command1", "command2"]
        },
        {
          "name": "window_2",
          "panes": ["command3", "command4"]
        }
      ]
    }
  ]
}
  • name: Specifies the name of the saved preset.
  • windows: Array of windows in the preset.
    • name: Name of the window.
    • panes: Array of commands to run in each pane.

Contributing

Contributions are welcome. Feel free to open a pull request or submit an issue.

License

This project is licensed under the MIT License. See the LICENSE.md file for details.

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

txm-0.1.0.tar.gz (19.7 kB view details)

Uploaded Source

Built Distribution

txm-0.1.0-py3-none-any.whl (19.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: txm-0.1.0.tar.gz
  • Upload date:
  • Size: 19.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/3.7.2 pkginfo/1.8.2 requests/2.23.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.18

File hashes

Hashes for txm-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ac0177bdb304e3a1c20e4488ed0eb5ed28ff9c4b11ac3979f3b903a545513edc
MD5 7f0a73611227541d1e0de097a2679488
BLAKE2b-256 bcf9d30e05078d9354346b0641eaea8bd84eaf88d65eaf7104b744e67123348a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: txm-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 19.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/3.7.2 pkginfo/1.8.2 requests/2.23.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.18

File hashes

Hashes for txm-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d485f19faaf3bdc1816d2c3c9cdccac32a757b7333dc65e7d25ee9579c4a6562
MD5 166d6642fd509cf793648c5feeca5e0d
BLAKE2b-256 26d475dce40e58ac180f8699e8e8e899c55f147799f4a4b03ba781d8c5588ca0

See more details on using hashes here.

Supported by

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