make start_vnc work with Ubuntu 24.04: use RDP instead of VNC; replace icon
This commit is contained in:
parent
3bbf84aa27
commit
b2b2855b5e
|
@ -6,4 +6,4 @@ Terminal=false
|
||||||
StartupWMClass=zenity
|
StartupWMClass=zenity
|
||||||
StartupNotify=true
|
StartupNotify=true
|
||||||
Categories=Utility
|
Categories=Utility
|
||||||
Icon=/usr/share/icons/Adwaita/48x48/legacy/face-glasses.png
|
Icon=/usr/share/icons/Humanity/apps/48/application-x-vnc.svg
|
||||||
|
|
|
@ -9,17 +9,16 @@ SSH_USER=karin
|
||||||
|
|
||||||
(
|
(
|
||||||
flock -n 200 || { echo "already running, exiting."; exit 1; }
|
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))
|
password=$(echo -e $(od -vAn -N3 -tu4 < /dev/urandom))
|
||||||
info_text="Bildschirmfreigabe aktiv! Passwort: $password"
|
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
|
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="$!"
|
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
|
kill $ssh_pid
|
||||||
systemctl --user stop gnome-remote-desktop.service
|
systemctl --user stop gnome-remote-desktop.service
|
||||||
gsettings set org.gnome.desktop.remote-desktop.vnc enable false
|
grdctl rdp disable
|
||||||
) 200>"$LOCK_FILE"
|
) 200>"$LOCK_FILE"
|
||||||
|
|
Loading…
Reference in New Issue