Created
January 15, 2020 09:42
-
-
Save nexus166/27e54812ed74d0cf6b5f56bc63d010ad to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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