Skip to content

Instantly share code, notes, and snippets.

@rodhfr
Last active March 27, 2025 12:24
Show Gist options
  • Save rodhfr/a831c309dab5c75ae9858ce5884a75c8 to your computer and use it in GitHub Desktop.
Save rodhfr/a831c309dab5c75ae9858ce5884a75c8 to your computer and use it in GitHub Desktop.
Create virtual display with sway and share with wayvnc
swaymsg create_output
swaymsg output "HEADLESS-1" resolution 1600x720 #mobile "see something" resolution. others: #3840x2160 #1920x1080 #1280x720
wayvnc -o HEADLESS-1 :: #setup the wayvnc config file
# alternative
wayvnc --config="/home/rodhfr/.config/wayvnc/wayvnc.config" -o HDMI-A-1
##### ~/.config/wayvnc/config
#use_relative_paths=true
#address=::
#enable_auth=true
#username=yourusername
#password=veryhardpassword
#private_key_file=tls_key.pem
#certificate_file=tls_cert.pem
##### generate self signed certificate files
cd ~/.config/wayvnc/
openssl genpkey -algorithm RSA -out tls_key.pem
openssl req -new -x509 -key tls_key.pem -out tls_cert.pem -days 365
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment