Ver código fonte

Improve .Xauthority handling and detect wayland for x11vnc

bryan 3 anos atrás
pai
commit
1463eb3fd8
1 arquivos alterados com 8 adições e 0 exclusões
  1. 8 0
      installJRMC

+ 8 - 0
installJRMC

@@ -1113,6 +1113,14 @@ service_jriver-x11vnc() {
     # }
     # _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
         start_cmd="/usr/bin/x11vnc -display $DISPLAY -noscr -auth guess -forever -bg -nopw"
     else