Created
November 18, 2014 23:50
-
-
Save rkmax/6262e14d64ea58f8bb1c to your computer and use it in GitHub Desktop.
Setup a virtual screen for connect from VNC viewer (example VNC VIwer Android)
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/bash | |
WIDTH=1280 | |
HEIGHT=800 | |
x11_cmd=x11vnc | |
if [[ ! -z $(pgrep ${x11_cmd}) ]]; then | |
pkill ${x11_cmd} | |
fi | |
MODE=$(gtf ${WIDTH} ${HEIGHT} 60| egrep -v '#' | awk '{first = $1; $1 = ""; print $0, first; }') | |
MODE_NAME=$(echo ${MODE} | awk '{ print $1}') | |
OFFSET=$(xrandr | grep primary | awk '{ print $4}' | sed 's/\([0-9]*\)\(.*\)/\1/') | |
PRIMARY=$(xrandr | grep primary | awk '{print $1}') | |
VIRTUAL=VIRTUAL1 | |
xrandr --newmode ${MODE} 2> /dev/null | |
xrandr --addmode ${VIRTUAL} ${MODE_NAME} 2> /dev/null | |
xrandr --output ${VIRTUAL} --right-of ${PRIMARY} | |
LOG=/var/log/x11vnc.log | |
if [[ ! -f "${LOG}" ]]; then | |
sudo touch ${LOG} | |
sudo chown ${USER}. ${LOG} | |
fi | |
x11vnc -usepw -noxdamage -bg -forever -display $DISPLAY -clip "${WIDTH}x${HEIGHT}+${OFFSET}+0" -o ${LOG} | |
xset r |
How I can create the Virtual1 Display?
@Sergi030 i had the same issue, got it back after creating
/usr/share/X11/xorg.conf.d/20-intel.conf
Section "Device" Driver "Intel" Identifier "Intel" EndSection
I just found out you don't need vnc server, You can just use software like deskscreen and share ur virtual monitor lol
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks, works great!