File tree Expand file tree Collapse file tree 2 files changed +70
-0
lines changed Expand file tree Collapse file tree 2 files changed +70
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /usr/bin/env zsh
2+
3+ # This script launches two applications using tmux in different windows/tabs.
4+ # The user is required to enter the name of at least the first application.
5+ # If the second isn't provided, then the user's default shell is launched for this.
6+ # You must have tmux installed and that can be done using your operating system's package manager.
7+ #
8+ # See the tmux Wiki for info on how to use it: https://github.com/tmux/tmux/wiki.
9+ # To shift focus between different windows in tmux use Ctrl-b followed by l (lowercase "L").
10+ #
11+ # NOTE: IF you have byobu installed, it is a wrapper around tmux and will likely run instead of tmux.
12+ # For info on how to use Byobu, see: https://www.byobu.org/
13+ # To shift focus between windows/tabs in byobu, simply hit F3.
14+
15+ # Function to print in red
16+ print_red () {
17+ echo -e " \e[31m$* \e[0m"
18+ }
19+
20+ if [ $# -eq 0 ];
21+ then
22+ print_red " No arguments supplied and this script requires at least one"
23+ exit 1
24+ fi
25+
26+ FIRST_COMMAND=$1
27+
28+ if [ $# -eq 1 ]
29+ then
30+ SECOND_COMMAND=$SHELL
31+ else
32+ SECOND_COMMAND=$2
33+ fi
34+
35+ tmux new-session -s " tmux window demo" -n " $FIRST_COMMAND " " $FIRST_COMMAND ;read" \; \
36+ new-window -n " $SECOND_COMMAND " " $SECOND_COMMAND ; read" \; previous-window
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env zsh
2+
3+ # This script launches two applications using byobu in different tabs.
4+ # The user is required to enter the name of at least the first application.
5+ # If the second isn't provided, then the user's default shell is launched for this.
6+ #
7+ # byobu must be installed for this script to work and you can install it using your
8+ # operating system package manager. or info on how to use Byobu, see: https://www.byobu.org/
9+ #
10+ # To shift focus between tabs in byobu, just hit F3.
11+
12+ # Function to print in red
13+ print_red () {
14+ echo -e " \e[31m$* \e[0m"
15+ }
16+
17+ if [ $# -eq 0 ];
18+ then
19+ print_red " No arguments supplied and this script requires at least one"
20+ exit 1
21+ fi
22+
23+ FIRST_COMMAND=$1
24+
25+ if [ $# -eq 1 ]
26+ then
27+ SECOND_COMMAND=$SHELL
28+ else
29+ SECOND_COMMAND=$2
30+ fi
31+
32+ tmux new-session " $FIRST_COMMAND ; read" \; \
33+ split-window " $SECOND_COMMAND ; read" \; \
34+ select-layout even-vertical
You can’t perform that action at this time.
0 commit comments