Improve .Xauthority handling and detect wayland for x11vnc

This commit is contained in:
2022-01-14 10:53:06 -05:00
parent 49ca1cf557
commit 1463eb3fd8

View File

@@ -1113,6 +1113,14 @@ service_jriver-x11vnc() {
# } # }
# _getResolution # _getResolution
# If .Xauthority file is missing, generate a dummy for x11vnc -auth guess
if [[ ! -f "$HOME/.Xauthority" ]]; then
[[ "$XDG_SESSION_TYPE" == "wayland" ]] && ask_ok "Unsupported Wayland session detected for x11vnc, continue?" || return 1
touch "$HOME/.Xauthority"
xauth generate "$DISPLAY" . trusted
xauth add "$HOST$DISPLAY" . "$(xxd -l 16 -p /dev/urandom)"
fi
if (( NOVNCAUTH )); then if (( NOVNCAUTH )); then
start_cmd="/usr/bin/x11vnc -display $DISPLAY -noscr -auth guess -forever -bg -nopw" start_cmd="/usr/bin/x11vnc -display $DISPLAY -noscr -auth guess -forever -bg -nopw"
else else