Skip to content

Instantly share code, notes, and snippets.

@nexus166
Created January 15, 2020 09:42
Show Gist options
  • Select an option

  • Save nexus166/27e54812ed74d0cf6b5f56bc63d010ad to your computer and use it in GitHub Desktop.

Select an option

Save nexus166/27e54812ed74d0cf6b5f56bc63d010ad to your computer and use it in GitHub Desktop.
#!/bin/sh -ex
_sudo=""
[ $(id -u) != 0 ] && export _sudo="sudo"
$_sudo dbus-launch gsettings set org.gnome.settings-daemon.plugins.sharing active true
$_sudo dbus-launch gsettings set org.gnome.settings-daemon.plugins.sharing.service:/org/gnome/settings-daemon/plugins/sharing/vino-server/ enabled-connections "[ $(nmcli -t -f uuid,type c s --active | grep 802 | awk -F ":" '{ print "'\''" $1 "'\''" }' | paste -s -d, -) ]"
$_sudo dbus-launch gsettings set org.gnome.Vino authentication-methods "['vnc']"
set +x
vncpassword=$(openssl rand -base64 16 || tr -cd '[:graph:]' < /dev/urandom | tr -d '\-#&\+,\.\/\:\`\"'\' | head -c16)
$_sudo dbus-launch gsettings set org.gnome.Vino vnc-password $(printf '%s' "$vncpassword"|base64);
printf 'Password:\t%s\n\n' "$vncpassword";
#$_sudo dbus-launch --exit-with-session gsettings set org.gnome.Vino require-encryption false
$_sudo dbus-launch gsettings set org.gnome.Vino prompt-enabled false
DISPLAY=:0 /usr/lib/vino/vino-server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment