Giter Club home page Giter Club logo

tmunix's Introduction

tmux + unix = tmunix

Manage tmux windows with power of unix tools.

Motivation

There are already other tools that let you manage your tmux sessions based on config files. The problem is you can configure only what this tools provide. With tmunix the config files are pure bash scripts letting you do whatever you want when setting up the tmux. tmunix is implemented in bash leaving all the complex tools behind.

Installation

Clone this repository.

Configuration

First prepare some configuration files in ~/.tmunix directory. The config file is just an ordinary bash script with some predefined functions (read further for details). Here is an example:

#!/usr/bin/env bash

# this path will be used in all the panes of this window
default-path /path/to/my_project

# it will be always placed to number 1
window-number 1

# there will be 4 panes
pane
pane
pane
pane
# root will be logged in on the last pane
cmd ssh root@localhost

If the config file for the window is not found ~/.tmunix/default file will be used.

You can copy sample config files to get things up and running:

cp -r ./sample_config ~/.tmunix

Usage

# open `my_project` and set window number to 2.
tmunix -w my_project -n 2

# set the current window using `2panes` config file.
tmunix -w temporary -c 2panes -t

See tmunix -h for more options

You can also define functions or alises in your ~/.bashrc to predefine often used commands. Such as:

TMUNIX_CMD=~/Projects/tmunix/tmunix
function tx(){
  if [ -z $2 ]; then
    $TMUNIX_CMD -w $1
  else
    $TMUNIX_CMD -w $1 -n $2
  fi
}

Predefined config functions

tmunix provides some commands you can use in the config files:

  • default-path path/to/your/project - always open panes in this window on this path
  • pane - open a pane
  • cmd command args - run a command in the last opened pane
  • tiled-layout - set tiled layout
  • horizontal-layout - set horizontal layout
  • vertical-layout - set vertical layout

License

MIT http://www.opensource.org/licenses/MIT

tmunix's People

Contributors

ares avatar inecas avatar kepi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

lzap ares

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.