From 280c97d21abeccf08534baa6d9faa100e5e5a4d7 Mon Sep 17 00:00:00 2001 From: bryan Date: Mon, 27 Apr 2020 00:23:17 -0400 Subject: [PATCH] testing _next_display --- installJRMC | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/installJRMC b/installJRMC index e4bf7c3..0025a45 100755 --- a/installJRMC +++ b/installJRMC @@ -1076,10 +1076,19 @@ EOF" _setDisplayAndPort() { # Check _display, else DISPLAY, else set to :0 by default - [[ -z $_display ]] && _display="${DISPLAY-":0"}" + if [[ -n $_display ]]; then + _next_display="$_display" + elif [[ -n $DISPLAY ]]; then + _display="${DISPLAY}" + _displaynum="${_display#:}" # strip colon + _displaynum="${_displaynum%.*}" # strip suffix + _next_displaynum=$(( _displaynum + 1 )) + _next_display=":$_next_displaynum" + else + _display=":0" + _next_display=":1" + fi - _displaynum="${_display#:}" # strip colon - _displaynum="${_displaynum%.*}" # strip suffix _port=$(( _displaynum + 5900 )) } @@ -1182,16 +1191,14 @@ EOF" _installPackage tigervnc-server - local _next_displaynum=$(( _displaynum + 1 )) - _next_display=":$_next_displaynum" - #local _service_port=$(( _port + 1 )) - _setVNCPass + echo "finished _setVNCPass" + if [[ -n $_novncauth ]]; then - _exec_start_cmd="/usr/bin/vncserver $_next_display -geometry 1440x900 -alwaysshared -fg -SecurityTypes None -xstartup /usr/bin/mediacenter$_mversion" + _exec_start_cmd="/usr/bin/vncserver $_next_display -geometry 1440x900 -alwaysshared -name jriver$_next_display -SecurityTypes None -autokill -xstartup /usr/bin/mediacenter$_mversion" else - _exec_start_cmd="/usr/bin/vncserver $_next_display -geometry 1440x900 -alwaysshared -fg -rfbauth $HOME/.vnc/jrmc_passwd -xstartup /usr/bin/mediacenter$_mversion" + _exec_start_cmd="/usr/bin/vncserver $_next_display -geometry 1440x900 -alwaysshared -rfbauth $HOME/.vnc/jrmc_passwd -autokill -xstartup /usr/bin/mediacenter$_mversion" fi _bash_cmd "cat <<-EOF > $_service_fname @@ -1205,6 +1212,7 @@ $_user_specifier ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill $_next_display > /dev/null 2>&1 || :' ExecStart=$_exec_start_cmd ExecStop=/usr/bin/vncserver -kill $_next_display +Restart=always [Install] WantedBy=multi-user.target @@ -1232,7 +1240,7 @@ EOF" debug "Running: ${FUNCNAME[0]}" - installPackage xorg-x11-utils + _installPackage xorg-x11-utils _res=$(xdpyinfo | grep dimensions | awk '{print $2}') } _getResolution