testing _next_display

This commit is contained in:
2020-04-27 00:23:17 -04:00
parent 6eb20a33ff
commit 280c97d21a

View File

@@ -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