From 63cfefa1fcf4d0a446283ccbb0e3060c2d4bb11f Mon Sep 17 00:00:00 2001 From: tem Date: Thu, 22 Feb 2024 08:09:27 +0300 Subject: [PATCH] Bump sunshine to stable & include res script from lyzardbyte docs --- Dockerfile.debian | 2 +- overlay/usr/bin/set-custom-res.sh | 35 +++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100755 overlay/usr/bin/set-custom-res.sh diff --git a/Dockerfile.debian b/Dockerfile.debian index 1873417..4553448 100644 --- a/Dockerfile.debian +++ b/Dockerfile.debian @@ -453,7 +453,7 @@ RUN \ echo # Install Sunshine -COPY --from=lizardbyte/sunshine:1303def-debian-bookworm /sunshine.deb /usr/src/sunshine.deb +COPY --from=lizardbyte/sunshine:v0.21.0-debian-bookworm /sunshine.deb /usr/src/sunshine.deb RUN \ echo "**** Update apt database ****" \ && apt-get update \ diff --git a/overlay/usr/bin/set-custom-res.sh b/overlay/usr/bin/set-custom-res.sh new file mode 100755 index 0000000..3ba027b --- /dev/null +++ b/overlay/usr/bin/set-custom-res.sh @@ -0,0 +1,35 @@ +#!/bin/bash +### +# File: set-custom-res.sh +# Project: bin +# Author: LyzardByte Community Docs +### + +# Get params and set any defaults +width=${1:-1920} +height=${2:-1080} +refresh_rate=${3:-60} + +# You may need to adjust the scaling differently so the UI/Text isn't too small / big +scale=${4:-1} + +# Get the name of the active display +display_output=$(xrandr | grep " connected" | awk '{print $1 }') + +# Get the modeline info from the 2nd row in the cvt output +modeline=$(cvt ${width} ${height} ${refresh_rate} | awk 'FNR == 2') +xrandr_mode_str=${modeline//Modeline \"*\" /} +mode_alias="${width}x${height}" + +echo "xrandr setting new mode ${mode_alias} ${xrandr_mode_str}" +xrandr --newmode ${mode_alias} ${xrandr_mode_str} +xrandr --addmode ${display_output} ${mode_alias} + +# Reset Scaling +xrandr --output ${display_output} --scale ${scale} + +# Apply new xrandr mode +xrandr --output ${display_output} --primary --mode ${mode_alias} --pos 0x0 --rotate normal --scale ${scale} + +# Optionally reset your wallpaper +# xwallpaper --zoom /path/to/wallpaper.png