GithubHelp home page GithubHelp logo

pxlctzn / tmux-sessionizer Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 1 KB

facilitates the management of tmux sessions by allowing users to quickly select a project directory and either create a new tmux session or switch to an existing one associated with that directory.

Shell 100.00%

tmux-sessionizer's Introduction

Tmux Sessionizer

This script facilitates the management of tmux sessions by allowing users to quickly select a project directory and either create a new tmux session or switch to an existing one associated with that directory.

Overview

This script is based on ThePrimeagen's blazingly fast tmux-sessionizer script but instead of reliyng on a static list of directories I choose to setup an ENVAR TMS_PJ_DIRS to define the list of directories to choose from.

If TMS_PJ_DIRS is not defined, tmux-sessionizer will use the current directory.

Requirements

Blazingly Fast Installation

$ git clone github.com/pxlctzn/tmux-sessionizer && chmod +x ./tmux-sessionizer && mv ~/.local/bin/scripts/tmux-sessionizer && echo "export PATH=$PATH:~/.local/bin/scripts" >> ~/.bashrc
  1. Download the script using git clone: $ git clone github.com/pxlctzn/tmux-sessionizer;
  2. Make it executable: $ chmod +x tmux_sessionizer;
  3. Move the tmux_sessionizer file (not the directory) into ~/.local/bin/scripts/;
  4. Add the ~/.local/bin/scripts/ directory to your PATH.

See, blazingly fast!

Don't forget to reload your terminal or source ~/.bashrc to use tmux-sessionizer.

Setup

Create an ENVAR named TMS_PJ_DIRS listing your projects top directory. The expected format is : "/path/to/directory1 /path/to/directory2 /path/to/directory3"

Usage

$ tmux_sessionizer [directory]
  • If a directory is provided as an argument, the script will use that directory for selection.
  • If no argument is provided, the script will use the directories specified in the TMS_PJ_DIRS ENVAR for selection.
    • If TMS_PJ_DIRS is not defined, the script will default to using the current directory for selection.
  • If a directory is selected (either through TMS_PJ_DIRS or as an argument), the script checks if a tmux session with the same name exists. If not, it creates a new session with that name and sets the working directory to the selected directory.
  • If a tmux session with the selected name already exists, the script switches to that session.

Acknowledgments

The script is based on ThePrimeagen's original tmux-sessionizer. Watch out though, it is blazingly fast. Uses fzf for fuzzy directory selection.

tmux-sessionizer's People

Contributors

pxlctzn avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.