3

I would like Byobu to start with 4 windows (Byobu in the Byobu sense, not in the Ubuntu sense):

  • One window showing top
  • One window showing a bash in /
  • One window showing a bash in $HOME
  • One window showing a vim on an existing file

So I wrote this in my ~/.byoburc:

byobu new-session -s my -n Top -d "top"
byobu new-window -t my -d -n Root -c /
byobu new-window -t my -d -n Personal
byobu new-window -t my -d -n Notes -d "vim /home/nico/notes.txt"

And now byobu does not even start, I guess it just calls itself. So I tried removing the byobu part:

new-session -s my -n Top -d "top"
new-window -t my -d -n Root -c /
new-window -t my -d -n Personal
new-window -t my -d -n Notes -d "vim /home/nico/notes.txt"

But it says it does not find the new-session command.

QUESTION: What is the correct syntax?

1 Answer 1

2
+50

If you read man byobu , specifically WINDOWS section, it says:

Users can create a list of windows to launch at startup in $BYOBU_CONFIG_DIR/windows and $BYOBU_CONFIG_DIR/windows.tmux. This file is the same syntax as ~/.screenrc and ~/.tmuxrc, each line specifying a window, as described in screen(1) or tmux(1).

So running byobu and doing echo $BYOBU_CONFIG_DIR tells me the files are in /home/username/.byobu. Now, windows file didn't work, but windows.tmux file, did do the trick of opening bash, nano, and htop. Basically, that's what i have there.

$ cat .byobu/windows.tmux 
new-session bash ; 
new-window htop ;
new-window nano;

Now, since I am not so well versed with tmux, much less tmuxrc file, I can only give you this much. There is a -c flag, for starting directory, so for example I could do new-session -c / bash ; to start in root directory. But so far I've no idea how to make vi launch with a file

You must log in to answer this question.

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