Git Product home page Git Product logo

virtualvncscreen's Introduction

VirtualVncScreen

Create a remote monitor via VNC (x11vnc)

This script is an automatization of an virtual vnc connected monitor.

Use scenario:

  • Use other device monitor as your main machine monitor

My use case:

I have a Raspberry pi (Rpi) with a monitor connected to it and my laptop and an hdmi monitor connected to it, on my laptop I run virtualVncScreen.sh this is the vnc server connected to virtual monitor created via xrandr. And on my Rpi, I run vncViewerListener.sh and pass as argument the ip I want to listen. I also added to autostart those scripts, so when machines reboots both still running properly.

Install and config


This script require xrandr and x11vnc for running properly,

sudo apt install xrandr x11vnc

And I'm using xtightvncviewer to connect to x11vnc server (with virtual monitor)

sudo apt install xtightvncviewer
  1. Check if virtual monitor is enabled xrandr --verbose
eDP1 connected primary 

...

HDMI1 disconnected

...

VIRTUAL1 connected (normal left inverted right x axis y axis)
        Identifier: 0x46
        Timestamp:  3213300
        Subpixel:   no subpixels
        Clones:     VIRTUAL2
        CRTCs:      3 4
        Transform:  1.000000 0.000000 0.000000
                    0.000000 1.000000 0.000000
                    0.000000 0.000000 1.000000
                   filter: 
        non-desktop: 0 
                supported: 0, 1
  1440x900_60.00 (0x1cc) 104.580MHz -HSync +VSync
        h: width  1440 start 1520 end 1672 total 1904 skew    0 clock  54.93KHz
        v: height  900 start  901 end  904 total  931           clock  59.00Hz
VIRTUAL2 disconnected (normal left inverted right x axis y axis)
        Identifier: 0x47
        Timestamp:  3213300
        Subpixel:   no subpixels
        Clones:     VIRTUAL1
        CRTCs:      3 4
        Transform:  1.000000 0.000000 0.000000
                    0.000000 1.000000 0.000000
                    0.000000 0.000000 1.000000
                   filter: 
        non-desktop: 0 
                supported: 0, 1

If you don't have VIRTUAL1 and VIRTUAL2 check This topic

  1. Some changes may bee required to virtualVncScreen.sh, you may need to modify the screen resolution in my case is 1440x900 wiith 60 refresh rate.
function initVirtualMonitor {
	gtf 1440 900 60
	xrandr --newmode "1440x900_60.00"  104.58  1440 1520 1672 1904  900 901 904 931  -HSync +Vsync
	xrandr --addmode VIRTUAL1 1440x900_60.00
	xrandr --output VIRTUAL1 --mode 1440x900_60.00 --pos 0x540 --output HDMI1 --pos 1440x0
	xrandr --verbose
}

Change all the --mode <your_new_mode_name> everywhere

virtualvncscreen's People

Contributors

emptyshell avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.