make start_vnc work with Ubuntu 24.04: use RDP instead of VNC; replace icon

This commit is contained in:
Christian Ulrich 2024-08-24 13:20:22 +02:00
parent 3bbf84aa27
commit b2b2855b5e
No known key found for this signature in database
GPG Key ID: 8241BE099775A097
2 changed files with 7 additions and 8 deletions

View File

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

View File

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