Add scripts for dummy displays

for remote streaming dummy display to external device
 like tablet or laptop
This commit is contained in:
Przemek Grondek 2022-05-16 22:29:33 +02:00
parent ec4e5de619
commit b0f3b01ee8
2 changed files with 50 additions and 0 deletions

28
bin/add-dummy-display Executable file
View File

@ -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

22
bin/remove-dummy-display Executable file
View File

@ -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