From b0f3b01ee83a7bfaa9038b9286ac0265aa082e52 Mon Sep 17 00:00:00 2001 From: Przemek Grondek Date: Mon, 16 May 2022 22:29:33 +0200 Subject: [PATCH] Add scripts for dummy displays for remote streaming dummy display to external device like tablet or laptop --- bin/add-dummy-display | 28 ++++++++++++++++++++++++++++ bin/remove-dummy-display | 22 ++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100755 bin/add-dummy-display create mode 100755 bin/remove-dummy-display diff --git a/bin/add-dummy-display b/bin/add-dummy-display new file mode 100755 index 0000000..14c6dc4 --- /dev/null +++ b/bin/add-dummy-display @@ -0,0 +1,28 @@ +#!/bin/sh + +set -x + +DUMMY_MONITOR="HDMI-A-0" + +killall compton + +xrandr --newmode "2384x1668_60.00" 338.02 2384 2560 2824 3264 1668 1669 1672 1726 -HSync +Vsync +xrandr --addmode "$DUMMY_MONITOR" 2384x1668_60.00 +xrandr --output "$DUMMY_MONITOR" --mode 2384x1668_60.00 --below DisplayPort-0 +xrandr --output "$DUMMY_MONITOR" --scale 0.5x0.5 + + +# Workaround to disable flickering +xrandr --output DisplayPort-0 --scale 0.9999x0.9999 +xrandr --output DVI-D-0 --scale 0.9999x0.9999 + +compton & + +if test -f /usr/share/backgrounds/brad-huchteman-stone-mountain.jpg ; then + feh --bg-scale /usr/share/backgrounds/brad-huchteman-stone-mountain.jpg & +else + if test -f /usr/share/backgrounds/gnome/Road.jpg ; then + feh --bg-scale /usr/share/backgrounds/gnome/Road.jpg & + fi +fi + diff --git a/bin/remove-dummy-display b/bin/remove-dummy-display new file mode 100755 index 0000000..0eacec0 --- /dev/null +++ b/bin/remove-dummy-display @@ -0,0 +1,22 @@ +#!/bin/sh + +DUMMY_MONITOR=HDMI-A-0 + +killall compton + +xrandr --output $DUMMY_MONITOR --off +xrandr --delmode $DUMMY_MONITOR "2384x1668_60.00" + +# Remove workaround +xrandr --output DisplayPort-0 --scale 1x1 +xrandr --output DVI-D-0 --scale 1x1 + +compton & + +if test -f /usr/share/backgrounds/brad-huchteman-stone-mountain.jpg ; then + feh --bg-scale /usr/share/backgrounds/brad-huchteman-stone-mountain.jpg & +else + if test -f /usr/share/backgrounds/gnome/Road.jpg ; then + feh --bg-scale /usr/share/backgrounds/gnome/Road.jpg & + fi +fi