From 7bd8e9f120fec1f86da3b80f595cca2fdb46967e Mon Sep 17 00:00:00 2001 From: Aargh Rai Date: Thu, 13 Aug 2026 14:40:42 +0530 Subject: setup monitor doesn't work on init, so the script is shifted to scripts/ --- i3/config | 1 - i3/setup-vnc-monitor.sh | 31 ------------------------------- scripts/setup-vnc-monitor.sh | 31 +++++++++++++++++++++++++++++++ 3 files changed, 31 insertions(+), 32 deletions(-) delete mode 100755 i3/setup-vnc-monitor.sh create mode 100755 scripts/setup-vnc-monitor.sh diff --git a/i3/config b/i3/config index 37e6872..98a1dd7 100644 --- a/i3/config +++ b/i3/config @@ -130,7 +130,6 @@ bar { } exec --no-startup-id xrandr --auto -exec --no-startup-id ./setup-vnc-monitor.sh exec --no-startup-id nitrogen --restore set $bg #282828 diff --git a/i3/setup-vnc-monitor.sh b/i3/setup-vnc-monitor.sh deleted file mode 100755 index cfbcc2e..0000000 --- a/i3/setup-vnc-monitor.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/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 diff --git a/scripts/setup-vnc-monitor.sh b/scripts/setup-vnc-monitor.sh new file mode 100755 index 0000000..cfbcc2e --- /dev/null +++ b/scripts/setup-vnc-monitor.sh @@ -0,0 +1,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 -- cgit v1.2.3