Skip to main content

Tmux configuration intended for a dashboard

Project description

Tmux Dash

The point of this project was to have an easily configurable dashboard for tmux which would sit on window 0; essentially, it would have a todo list, various clocks, things of that nature.

There are a couple of alternatives, the one that really comes up often if you're googling around the phrases "terminal" and "dashboard" is wtfutil, my core issue with this is that the module selection is a little limited, I'm also not a big fan of the way it looks and configuration available doesn't really help that.

The other project of a similar nature is tmuxinator but I didn't want to use it as a binary replacement for tmux itself. I also wanted a config which is more focused on a specific layout, for which specific splits are defined for each pane.

Usage

From within a tmux session run this script and either use the default config ($HOME/.config/tmux-dash/config.yml) or specify a config file with the -c option.

Next is to specify a tmux session, this can be done with the session id with -i or session name with -n. Alternativley, if you are within a tmux session, specify nothing and tmux-dash will pick up on your $TMUX environment variable.

Configuration

A sample configuration could be:

  dashboard:
    number: 0
    vim-pane:
      command: vim
      split: null
    htop:
      command: htop
      split: 
        direction: horz
        width: 40
    head:
      command: "watch tail /var/log/pacman.log"
      split:
        from: vim-pane

This will create a window, numbered 0. In it will be vim in the first pane, creating no split (split: null), a horizontal split of width 40 containing an instance of htop, finally, splitting vertically from the pane marked vim-pane watching a log.

So, something like this,

  +-------------------+--------+
  |                   |        |
  |                   |        |
  |        Vim        |        |
  |                   |        |
  |                   |        |
  +-------------------+  Htop  |
  |                   |        |
  |                   |        |
  |   watch tail...   |        |
  |                   |        |
  |                   |        |
  +-------------------+--------+

Note here that ordering is important, same as setting up a window regularly in tmux. So if you create two panes, a and b, then split a horizontally, you have two on the top, one on the bottom. However, create a and b horizontally, then split a vertically, you get two on the left and one on the right.

The splits are literally made in the order they appear in the Yaml, and so, to reiterate, ordering is important.

The meta config would look something like the following:

  <window name>:
    number: <window number>
    <pane id>:
      [command: <command>]
      [module: <module>]
      split: (null|
        [direction: (horz|vert)]
        [from: <pane id>]
        [width: <char width>]
        [height: <char height>])
    <pane 2 id>:
      ...
  <window 2 name>:
    ...

Dependencies

Literally just the one, aside from Python3, is libtmux.

Additional Info

module refers to what you may find as an empty directory, these are to come, or for anyone who finds this to populate with scripts/binaries, its sole purpose is to put things that you may not necessarily want on your path, kind of pointless but hey.

The only thing that I wouldn't advise it setting up a configuration and not taking into account the fact that the script is running in a particular pane, obviously, that module/command won't be launched.

Hopefully, there's more to come.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tmux_dash-0.0.7-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

Details for the file tmux_dash-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: tmux_dash-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 12.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.1

File hashes

Hashes for tmux_dash-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 e0f024abd6956b32ceb4dc342f12e7038cd2549293b27c1b9bc092879ebd440e
MD5 ecac5be83bf773f8d7863f6d3979a70a
BLAKE2b-256 33c301ec176cb74b12cdae010a43eb7854fecc5d61fab437d3bcd0120b25d765

See more details on using hashes here.

Supported by

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