From d6649fa249d267f74f3a8f3654ee591fca91a7a7 Mon Sep 17 00:00:00 2001 From: bryan Date: Sun, 26 Apr 2020 23:59:52 -0400 Subject: [PATCH] testing _next_display --- installJRMC | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/installJRMC b/installJRMC index e4bf7c3..19eb7ef 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,10 +1191,6 @@ EOF" _installPackage tigervnc-server - local _next_displaynum=$(( _displaynum + 1 )) - _next_display=":$_next_displaynum" - #local _service_port=$(( _port + 1 )) - _setVNCPass if [[ -n $_novncauth ]]; then @@ -1232,7 +1237,7 @@ EOF" debug "Running: ${FUNCNAME[0]}" - installPackage xorg-x11-utils + _installPackage xorg-x11-utils _res=$(xdpyinfo | grep dimensions | awk '{print $2}') } _getResolution