Skip to content

Instantly share code, notes, and snippets.

@nathanmargaglio
Last active November 23, 2019 04:17
Show Gist options
  • Save nathanmargaglio/0bf146e015d65290d46f78bbdd75764c to your computer and use it in GitHub Desktop.
Save nathanmargaglio/0bf146e015d65290d46f78bbdd75764c to your computer and use it in GitHub Desktop.
Creating a Virtual Display for VNC using XRandR
# Create new modes
xrandr --newmode virtual_mode $(cvt 1920 1080 60 | grep -oP "\".*\" \K(.*)")
xrandr --newmode note10 $(cvt 2280 1080 60 | grep -oP "\".*\" \K(.*)")
xrandr --newmode note10_half $(cvt 1144 540 60 | grep -oP "\".*\" \K(.*)")
xrandr --newmode note10_half_flip $(cvt 540 1144 60 | grep -oP "\".*\" \K(.*)")
xrandr --newmode tablet $(cvt 1280 800 30 | grep -oP "\".*\" \K(.*)")
xrandr --newmode tablet_half $(cvt 640 400 30 | grep -oP "\".*\" \K(.*)")
xrandr --newmode tablet_quart $(cvt 960 600 30 | grep -oP "\".*\" \K(.*)")
export XMODE=tablet_quart
xrandr --addmode VIRTUAL1 $XMODE
xrandr --output VIRTUAL1 --mode $XMODE
# use `arandr` to visually adjust display positions, or
# (virtual screen coordinates)
# 0 1366 1366+1920
#
# 0 A-----------------------
# | |
# | |
# | |
# x? B---------| HDMI |
# | | |
# | LVDS | 1920x1080 |
# |1366x768 | |
# 1080 ----------------------------------
# https://superuser.com/questions/485120/how-do-i-align-the-bottom-edges-of-two-monitors-with-xrandr
xrandr --output eDP1 --pos 0x600 --output VIRTUAL1 --pos 0x0
# adb for direct connections via USB
adb reverse tcp:5900 tcp:5900
# Start VNC server into the first screen from the left
x11vnc --localhost --clip xinerama0 --forever
@nathanmargaglio
Copy link
Author

nathanmargaglio commented Oct 31, 2019

Note 10 Performance:
91% Battery at 09:20 AM running at ~50% brightness
81% Battery at 11:20 AM ''

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment