Skip to main content

Genelate layout template for tmuxinator.

Project description

panediv_nfw

Generate tmux layout string from simple format.

Install

$ pip3 install panediv-nfw

$ export PATH=$PATH:~/.local/bin/

PaneDiv

Automate tmux layout generation tools. With options, print layout information only. Without options, start tmux with the layout. Run this script on the outside of tmux.

Usage

$ panediv -h
usage: panediv [-h] [--tmuxinator] [--show_layout] [--show_commands] [--show_matrix] layout

Generate layout string from simple format.

positional arguments:
  layout               Layout string, ex.) {,}. Without other options, start tmux.

optional arguments:
  -h, --help           show this help message and exit
  --tmuxinator, -i     Export tmuxnator configuration.
  --show_layout, -l    Print layout string.
  --show_commands, -c  Print command list.
  --show_matrix, -m    Print pane number matrix.

Examples

Open tmux with complex layout from simple string.

Simple 3 rows

  • panediv '[,,]'
  • panediv '[3]'

Simple 3 columns

  • panediv '{,,}'
  • panediv '{3}'

Simple 3 rows with commands

  • panediv '[/usr/games/sl,"figlet \"pane 2\"",]'

Specify size, 10 lines, 15 lines, left

  • panediv '[(,10),(,15),]'

Specify size, 20 percent, 30 percent, left

  • panediv '[(,20%),(,30%),]'

Specify command and size

  • panediv '[(/usr/games/sl,20%),("figlet \"pane 2\"",10),]'

Complex layout

  • panediv '{[{,[2]},,{[2],}],,[{[2],},,{,[2]}]}'
  • panediv '{([4], 70%),,}'

Export TmuxInator configuration.

  • panediv -i /tmp/layout '{/usr/games/sl, [1,"figlet \"pane 3\"",2],}' && tmuxinator start -p /tmp/layout

pdv, pdc

Simply split current pane evenly.

Usage

$ pdv.py
usage: pdv.py [-h] [--vertical] num

Split pane evenly.

positional arguments:
  num             Divide pane into num. default: horiszontally.

optional arguments:
  -h, --help      show this help message and exit
  --vertical, -v  Divide vertically.

$ pdc -h
usage: pdc.py [-h] [--file FILE] [--vertical] [--instant] [commands [commands ...]]

Split pane and run commands. Input commands as args, filename(-f) or from pipe.

positional arguments:
  commands              Commands.

optional arguments:
  -h, --help            show this help message and exit
  --file FILE, -f FILE  Commands file or \n separated stdin
  --vertical, -v        Divide vertically.
  --instant, -i         Kill the pane when the command finished.

Examples

Split current pane horizontally

  • pdv 3

Split current pane vertically

  • pdv -v 3

Split current pane horizontally and run commands

  • pdc "echo 1" "echo 2"
  • echo "echo 1\necho 2" | pdc
  • for i in {1..2}; do echo "echo ${i}"; done | pdc 'echo 1' 'echo 2'
  • echo "echo 1\necho 2" > ./commands.txt && pdc -f ./commands.txt

Split current pane vertically

  • pdc -v "echo 1" "echo 2"

Split current but close then when command done.

  • pdc -i "echo 1" "echo 2; sleep 3"

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

panediv-nfw-0.1.2.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

panediv_nfw-0.1.2-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

Details for the file panediv-nfw-0.1.2.tar.gz.

File metadata

  • Download URL: panediv-nfw-0.1.2.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.10

File hashes

Hashes for panediv-nfw-0.1.2.tar.gz
Algorithm Hash digest
SHA256 98e2543735e5d34d27a345fa983707358bf2fea2b605fdacf51a919a73dd6ae2
MD5 97e35df0864576de3768e78259151ae1
BLAKE2b-256 1f439ac92c3639fe7a9d4073c5e2fd7e46b28a426a891c5a803a7942f01732bb

See more details on using hashes here.

File details

Details for the file panediv_nfw-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: panediv_nfw-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 12.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.10

File hashes

Hashes for panediv_nfw-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 69139d04c1f96c2fdf756e5cf3f9e2ff504b1efe23ad4913d895476018a05679
MD5 1ba3a17b02df6c08dbc565eabad9e789
BLAKE2b-256 2bfd663653542fde7d845c703dc36d19f67af3680c2d04c0233912a65d279e71

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