4

In Byobu 5.17 (using tmux 1.6), how ought I format the windows.tmux file? I've poked around a bit, but have been unable to find a proper answer.

For reference, here's the screen version of what I want:

screen -t log watch -n 10 tail -n 5 /var/log/syslog /var/log/auth.log /var/log/ dmesg
screen -t mem watch -n 30 "df -h; echo ""; free -mt"
screen -t top top
screen -t bash /bin/bash

Many thanks.

1
  • 1
    Is this really still not answerable? I haven't seen any windows.tmux instructions out there yet.
    – Tohuw
    Nov 9, 2013 at 16:35

2 Answers 2

1

Something like this should work, but you might also want to look into tmuxinator or tmuxp to specify tmux profiles in YAML.

new -s tmuxs # creates a new tmux session, replace "tmuxy" with whatever you'd like to name the session
new-window -n log 'watch -n 10 tail -n 5 /var/log/syslog /var/log/auth.log /var/log/dmesg'
new-window -n mem 'watch -n 30 "df -h; echo ""; free -mt"'
new-window -n top 'top'
new-window -n bash

It's pretty self explanatory, create a session and then start creating windows, naming them via '-n' and including the command you want to run as the last argument.

3

I finally found out how to get it to work. First you need an update to version Byobu 5.85 or later. Here is the corresponding commit with the fix and there is a PPA for Ubuntu.

First, check that the line source-file $BYOBU_CONFIG_DIR/windows.tmux in /usr/share/byobu/profiles/tmuxrc is uncommented or it won't work.

As you can see in updated documentation part of the commit you need to chain your commands with semicolons. To take the tmux example from the Arch Wiki and make it work it would look like this:

new -A -s SessionName -n WindowName nano;
neww -n foo/bar top;
splitw -v -p 50 -t 0 top;
selectw -t 1;
selectp -t 0

Don't forget to add -A to the new/new-session command or Byobu will be unable to reconnect to an existing session.

You should update to a newer version of tmux if you are on 14.04 or an older version than tmux 1.9, to avoid running into this issue: Create new-window with current directory in tmux

1
  • This question probably still gets a lot of hits, so let me amend this: If you have issues with split panes duplicating, and you are running Ubuntu 16.04, or just newer versions of Byobu DO NOT UNCOMMENT THE LINE IN /usr/share/byobu/profiles/tmuxrc.
    – Znuff
    Dec 27, 2017 at 0:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .