├── LICENSE ├── README.md ├── _config.yml ├── docs ├── README.md ├── _config.yml ├── _layouts │ └── default.html └── assets │ └── css │ └── style.css ├── tdab-icon.png ├── tdab-logo.png ├── tdab-open-graph.png ├── tdab_example.gif ├── tdab_example.mkv ├── tmux_devour.sh ├── tmux_sidebar.sh └── tmux_topbar.sh /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Steven Saus 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # tmux-devours-a-bar 2 | 3 | Create side and top bars in tmux easily, along with a "devour" style command. 4 | 5 |  6 | 7 |  8 | 9 | You can see a larger version of the demo with the [included MKV file](https://github.com/uriel1998/tdab/blob/master/tdab_example.mkv?raw=true). 10 | 11 | ## Contents 12 | 1. [About](#1-about) 13 | 2. [License](#2-license) 14 | 3. [Prerequisites](#3-prerequisites) 15 | 4. [Installation](#4-installation) 16 | 5. [Usage](#5-usage) 17 | 6. [Examples](#6-examples) 18 | 19 | *** 20 | 21 | ## 1. About 22 | 23 | These three scripts (called `TDAB` for short) will create side or top bars 24 | (or a "devour" style new pane) that run a command inside tmux. See the image 25 | above to get an idea of what this means. 26 | 27 | The name is a play on "A *blank* walks into a bar", because puns. 28 | 29 | ## 2. License 30 | 31 | This project is licensed under the MIT License. For the full license, see `LICENSE`. 32 | 33 | ## 3. Prerequisites 34 | 35 | * tmux 36 | * bash 37 | * bc 38 | 39 | These scripts will *probably* work in other shells, but I don't know for sure. 40 | 41 | ## 4. Installation 42 | 43 | Clone or download the repository. Put the scripts (or symlinks to the scripts) 44 | in your `$PATH`. (In the example above, I've symlinked them to `sidebar`, 45 | `topbar`, and `devour`.) 46 | 47 | ### Tip for `Devour` 48 | 49 | I find a binding like the following *very* useful when using `devour`: 50 | 51 | `bind-key -n C-/ select-pane -R \;\` 52 | `resize-pane -Z` 53 | 54 | This will allow you to cycle among the zoomed panes - and will zoom each as you 55 | go through it. Very nice for programs like [emojin](https://github.com/peterjschroeder/emojin). 56 | 57 | ## 5. Usage 58 | 59 | `SCRIPTNAME [--offset NUMBER] [--hold] [program to run]` 60 | 61 | For example, `tmux-sidebar.sh man man` will show you the man page for man in 62 | the sidebar. 63 | 64 | **The optional command line arguments are POSITIONAL.** 65 | 66 | Resizing the bars can be done with the command line argument --offset which is 67 | expressed in the percentage of the screen you want for the *main* window. This 68 | must be the first and second argument used. For example, to have a main window 69 | taking up 90% of the screen, you would use 70 | 71 | `tmux-topbar.sh --offset 90 man man` 72 | 73 | This works by resizing the *larger* pane from the center line. 74 | 75 | If the *second* argument is either `-h` or `--hold` then TDAB will pause after 76 | executing the program and wait for you to hit a key (necessary for programs that 77 | exit immediately, which triggers the pane closing). 78 | 79 | If you run the scripts outside of tmux, it will just run the command. 80 | 81 | ### tmux_devour.sh 82 | 83 | Launch a process in a new pane, zoom the pane, kill the pane when done. 84 | 85 | ### tmux_sidebar.sh 86 | 87 | Create a sidebar (e.g. for reading manpages) and kill when done. 88 | 89 | ### tmux_topbar.sh 90 | 91 | Create a vertical split and kill when done. 92 | 93 | ## 6. Examples 94 | 95 | Aside from invoking on the command line, I've found a couple of short wrapper scripts 96 | really make a difference, particularly if you want a specific setup. 97 | 98 | To call your editor in a new, full-screen pane (leaving the initial pane alone): 99 | 100 | `/home/steven/bin/tmux_devour.sh /usr/bin/micro "${@}"` 101 | 102 | To bring up [my address book searcher](https://github.com/uriel1998/ppl_virdirsyncer_addysearch) in a small topbar when I'm working in the 103 | main window: 104 | 105 | `/home/steven/bin/tmux_topbar.sh --offset 80 pplsearch -c` 106 | 107 | To bring up newsboat, with a sidebar showing a cheat sheet of things I forget using 108 | [rich-cli](https://github.com/Textualize/rich-cli), then closing it when I'm done. 109 | 110 | 111 | ``` 112 | /home/steven/bin/tmux_sidebar.sh rich -m /home/steven/cheatsheet/newsboat.md --pager 113 | newsboat 114 | sidebarpid=$(ps aux | grep "rich -m /home/steven/cheatsheet/newsboat.md" | grep -v grep | awk '{print $2}') 115 | kill $sidebarpid 116 | ``` 117 | 118 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-slate -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | # tmux-devours-a-bar 2 | 3 | Create side and top bars in tmux easily, along with a "devour" style command. 4 | 5 |  6 | 7 |  8 | 9 | You can see a larger version of the demo with the [included MKV file](https://github.com/uriel1998/tdab/blob/master/tdab_example.mkv?raw=true). 10 | 11 | ## Contents 12 | 1. [About](#1-about) 13 | 2. [License](#2-license) 14 | 3. [Prerequisites](#3-prerequisites) 15 | 4. [Installation](#4-installation) 16 | 5. [Usage](#5-usage) 17 | 6. [TODO](#6-todo) 18 | 19 | *** 20 | 21 | ## 1. About 22 | 23 | These three scripts (called `TDAB` for short) will create side or top bars 24 | (or a "devour" style new pane) that run a command inside tmux. See the image 25 | above to get an idea of what this means. 26 | 27 | The name is a play on "A *blank* walks into a bar", because puns. 28 | 29 | ## 2. License 30 | 31 | This project is licensed under the MIT License. For the full license, see `LICENSE`. 32 | 33 | ## 3. Prerequisites 34 | 35 | * tmux 36 | * bash 37 | 38 | These scripts will *probably* work in other shells, but I don't know for sure. 39 | 40 | ## 4. Installation 41 | 42 | Clone or download the repository. Put the scripts (or symlinks to the scripts) 43 | in your `$PATH`. (In the example above, I've symlinked them to `sidebar`, 44 | `topbar`, and `devour`.) 45 | 46 | If you wish to change the width or height of the sidebar/topbar, you will 47 | need to edit this line: 48 | 49 | `tmux resize-pane -t "$c_pane" -R 30` 50 | 51 | which actually resizes the *larger* pane from the center line. My screen that 52 | I used for the demo is 194 columns wide, so when it's first split, it's 97/96 53 | columns wide, then resizes it *to the right* an additional 30 columns so that 54 | I end up with a 127/67 split. The same thing goes for the topbar, except it 55 | resizes upward (-U). Adjust so that they work for your terminal size. 56 | 57 | ### Tip for `Devour` 58 | 59 | I find a binding like the following *very* useful when using `devour`: 60 | 61 | `bind-key -n C-/ select-pane -R \;\` 62 | `resize-pane -Z` 63 | 64 | This will allow you to cycle among the zoomed panes - and will zoom each as you 65 | go through it. Very nice for programs like [emojin](https://github.com/peterjschroeder/emojin). 66 | 67 | ## 5. Usage 68 | 69 | `SCRIPTNAME [program to run]` 70 | 71 | For example, `tmux-sidebar.sh man man` will show you the man page for man in 72 | the sidebar. 73 | 74 | If the *first* argument is either `-h` or `--hold` then TDAB will pause after 75 | executing the program and wait for you to hit a key (necessary for programs that 76 | exit immediately, which triggers the pane closing). 77 | 78 | If you run the scripts outside of tmux, it will just run the command. 79 | 80 | ### tmux_devour.sh 81 | 82 | Launch a process in a new pane, zoom the pane, kill the pane when done. 83 | 84 | ### tmux_sidebar.sh 85 | 86 | Create a sidebar (e.g. for reading manpages) and kill when done. 87 | 88 | ### tmux_topbar.sh 89 | 90 | Create a vertical split and kill when done. 91 | 92 | ## 6. TODO 93 | 94 | * Have a configurable size modifier so nobody needs to edit the script. 95 | -------------------------------------------------------------------------------- /docs/_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-midnight -------------------------------------------------------------------------------- /docs/_layouts/default.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | {% seo %} 8 | 9 | 10 | 11 | 14 | 17 | 18 | 19 | 20 | 21 |{{ site.description | default: site.github.project_tagline }}
38 |Steven Saus injects people with radioactivity for his day job, but only to serve the forces of good.
Mostly.