forked from fontify/fontify
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fontify_tmux.sh
executable file
·33 lines (27 loc) · 1007 Bytes
/
fontify_tmux.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
# fontify_tmux.sh for https://github.com/Naereen/fontify/
# MIT Licensed, https://lbesson.mit-license.org/
#
# Script to start a new tab in a tmux session, launching the app and ngrok in two panes
echo -e "${yellow}Starting '${black}fontify_tmux.sh'${reset} ..."
if [ -L "${BASH_SOURCE[0]}" ]; then
# We have a symlink... how to deal with it?
cd "$( dirname "$(readlink -f "${BASH_SOURCE[0]}")" )"
else
cd "$( dirname "${BASH_SOURCE[0]}" )"
fi;
# XXX assume runing inside a tmux session
if [ "X${TMUX}" = "X" ]; then
echo -e "${red}This script ${black}${0}${red} has to be run inside a tmux session.${reset}"
exit 1
fi
# Reference tmux man page (eg. https://linux.die.net/man/1/tmux)
# start a new window,
# name it ulogme
tmux new-window -a -n 'fontify' "tmux split-window -d \"make rundebug\" ; ngrok http 5000"
# launch 'make rundebug' in first one
# split it half
# launch 'ngrok http 5000' in second one
sleep 2
# return to current tab at the end
tmux last-window