You are not logged in.

#1 2016-11-18 18:29:39

smacz
Member
Registered: 2015-12-26
Posts: 8

Launching Persistant Terminals from the menu with tmux

I've recently ported in all of the Kali Linux tools into a BL install that I had taken to testing (side note: I had to pin testing above kali to prevent it from getting borked). There's a distro - Kalibang - that uses OB and claims to be inspired by #!.

So I got all of the menu options out of that setup, but turns out that most of them are just displaying the help dialog (command -h) in the terminal. Now, I use tmux on all of my terminals on my Arch machine, and didn't want to go without it in this new setup.

When using the `-e` switch with `x-terminal-emulator`, the command argument is expected to be a single item, so a little trickery is needed from the get-go, namely:

x-terminal-emulator -e bash -c "${command1}; ${command2}"

So now there's a framework to try something convoluted like stringing together many tmux commands just to get the output of the program to show and then be dropped to a shell prompt after. But that's not too pretty, is it?

So, I remembered that I've been using tmuxinator on my Arch machine for my BSPWM startup sequence, and figured I'd give that a go. Oddly enough, it requires the above trickery, but works like a charm. For instance:

# ~/.tmuxinator/ike-scan.yml

name: ike-scan
root: ~/

windows:
  - editor:
      layout: main-vertical
      panes:
        - ike-scan -h | less

With a menu entry of:

<item label="ike-scan">
    <action name="Execute">
        <command>
            x-terminal-emulator -e bash -c "tmuxinator start ike-scan"
        </command>
    </action>
</item>

Pulls up the output of the command in `less`, and then drops me at a command prompt when I quit, so that I can then go about my business! Hope this helps somebody. I know it had been on my wishlist for awhile.

(P.S. ike-scan has some oddities about stdout, so piping `vim -h`, etc...into less would be a better example)

Last edited by smacz (2016-11-18 18:34:44)

Offline

Board footer

Powered by FluxBB