From 609ef528ef1d4c0411299f77dd623dcce3e53a44 Mon Sep 17 00:00:00 2001 From: Nils Date: Sat, 10 Jul 2021 20:09:36 +0200 Subject: [PATCH] add ability to toggle tmux use --- README.md | 2 ++ docker-compose.yml | 1 + run.sh | 6 +++++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 52e0182..9502749 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ this is a dynamically built gotty container - title - set application title (browser and tmux session title, def. gotty) - pkgs - additional packages to install when the container is started (optional, def. none) - command - the command to run (required, def. none/pfetch) +- use_tmux - either open a subshell for every page load (false) or just attach to a single shell started at the beginning (true) (optional, def. true) ## compose this example can also be found in the repo @@ -44,6 +45,7 @@ services: - title=1234 - pkgs=htop - command=htop + - use_tmux=true ``` diff --git a/docker-compose.yml b/docker-compose.yml index 82a83f8..ee2b200 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -13,3 +13,4 @@ services: - title=1234 - pkgs=htop - command=htop + - use_tmux=true diff --git a/run.sh b/run.sh index 857ad39..e891442 100644 --- a/run.sh +++ b/run.sh @@ -19,4 +19,8 @@ if [ -z "$command" ];then command="curl -s https://raw.githubusercontent.com/dylanaraps/pfetch/master/pfetch | ash && figlet no command set && read swag" fi -/gotty -p "$port" $creds --title-format "$title" tmux new-session -A -s "$title" "$command" \ No newline at end of file +if [ "$use_tmux" == "false" ];then + /gotty -p "$port" $creds --title-format "$title" "$command" +else + /gotty -p "$port" $creds --title-format "$title" tmux new-session -A -s "$title" "$command" +fi \ No newline at end of file