aboutsummaryrefslogtreecommitdiff
path: root/i3/setup-vnc-monitor.sh
blob: cfbcc2e19b2919440381696f33487d79e10fd120 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env bash

set -euo pipefail

export DISPLAY=:0

# Make the X framebuffer large enough for:
#   physical monitor: 1920x1080
#   VNC monitor:      1366x768
#
# Total width = 1920 + 1366 = 3286
xrandr --fb 3286x1080

# Remove the default Xvnc-style monitor if one exists.
xrandr --delmonitor VNC-0 2>/dev/null || true

# Don't create duplicates when i3 reloads.
xrandr --delmonitor VNC-1 2>/dev/null || true
xrandr --delmonitor VNC-2 2>/dev/null || true

# Physical monitor is 1920x1080 at 0,0.
xrandr --setmonitor PHYSICAL \
    1920/509x1080/286+0+0 \
    none

# Virtual VNC monitor is 1366x768 at 1920,0.
xrandr --setmonitor VNC \
    1366/361x768/203+1920+0 \
    none

xrandr --listmonitors