From b2b2855b5e2e4eda8877dcc96238bb7550fe2f95 Mon Sep 17 00:00:00 2001 From: Christian Ulrich Date: Sat, 24 Aug 2024 13:20:22 +0200 Subject: [PATCH] make start_vnc work with Ubuntu 24.04: use RDP instead of VNC; replace icon --- network/start_vnc/start_vnc.desktop | 2 +- network/start_vnc/start_vnc.sh | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/network/start_vnc/start_vnc.desktop b/network/start_vnc/start_vnc.desktop index 6fbf278..a8c15a8 100644 --- a/network/start_vnc/start_vnc.desktop +++ b/network/start_vnc/start_vnc.desktop @@ -6,4 +6,4 @@ Terminal=false StartupWMClass=zenity StartupNotify=true Categories=Utility -Icon=/usr/share/icons/Adwaita/48x48/legacy/face-glasses.png +Icon=/usr/share/icons/Humanity/apps/48/application-x-vnc.svg diff --git a/network/start_vnc/start_vnc.sh b/network/start_vnc/start_vnc.sh index b9f4e49..1361e97 100644 --- a/network/start_vnc/start_vnc.sh +++ b/network/start_vnc/start_vnc.sh @@ -9,17 +9,16 @@ SSH_USER=karin ( flock -n 200 || { echo "already running, exiting."; exit 1; } - gsettings set org.gnome.desktop.remote-desktop.vnc auth-method 'password' - gsettings set org.gnome.desktop.remote-desktop.vnc view-only false - gsettings set org.gnome.desktop.remote-desktop.vnc enable true password=$(echo -e $(od -vAn -N3 -tu4 < /dev/urandom)) info_text="Bildschirmfreigabe aktiv! Passwort: $password" - echo -n "$password" | secret-tool store --label="GNOME Remote Desktop VNC password" "xdg:schema" "org.gnome.RemoteDesktop.VncPassword" + grdctl rdp disable-view-only + grdctl rdp set-credentials "admin" "$password" + grdctl rdp enable systemctl --user start gnome-remote-desktop.service - ssh -C -N -R 5900:localhost:5900 -p $SSH_PORT $SSH_USER@$SSH_HOST & + ssh -C -N -R 3389:localhost:3389 -p $SSH_PORT $SSH_USER@$SSH_HOST & ssh_pid="$!" - zenity --title="Bildschirmfreigabe auf $(hostname)" --info --text="$info_text" --width=230 --ok-label="Beenden" --icon-name="$ICON" + zenity --title="Bildschirmfreigabe auf $(hostname)" --info --text="$info_text" --width=230 --ok-label="Beenden" --icon="$ICON" kill $ssh_pid systemctl --user stop gnome-remote-desktop.service - gsettings set org.gnome.desktop.remote-desktop.vnc enable false + grdctl rdp disable ) 200>"$LOCK_FILE"