Unix
Start terminator with custom layout and commands
Jared
2017. 11. 15. 16:33
Starting Terminator with split screens is quite simple: Just store a layout and start Terminator with the --layout <your layout>
option.
However, if you want to run custom commands in your terminals, you need to do some work to keep these terminals from closing after a command exits. You accomplish this by tweaking bash to run a command before actually starting.
Pimp your .bashrc
Add this to the end of .bashrc
:
# hack to keep a bash open when starting it with a command[[ $startup_cmd ]] && { declare +x $startup_cmd; eval "$startup_cmd"; }
Store a Terminator layout
- Open Terminator preferences
- Go to the Layouts tab
- Press "Add"
- Add a custom command to each split terminal. Format:
env startup_cmd="<your_command>" bash
Edit Terminator boot command
In case you ALWAYS want to run Terminator with certain options, run sudo vim /usr/share/applications/terminator.desktop
and change the Exec
line to this:
Exec=terminator --layout <your_layout> --maximise --working-directory=<working_directory>