Switch moonlight to use autostart so the configuration is updated per device from the framebuffer res.

This commit is contained in:
fewtarius 2023-04-23 22:29:32 +00:00
parent 4f6472e9c9
commit 91c0e9fd5a
No known key found for this signature in database
GPG key ID: F4AE55305D1B8C1A
6 changed files with 17 additions and 37 deletions

View file

@ -0,0 +1,9 @@
#!/bin/sh
# SPDX-License-Identifier: Apache-2.0
# Copyright (C) 2023-present Fewtarius (https://github.com/fewtarius)
FBWIDTH=$(fbset | awk '/geometry/ {print $2}')
FBHEIGHT=$(fbset | awk '/geometry/ {print $2}')
sed -i "s#@MWIDTH@#${FBWIDTH}#g" /storage/.config/moonlight/moonlight.conf
sed -i "s#@MHEIGHT@#${FBHEIGHT}#g" /usr/config/moonlight/moonlight.conf

View file

@ -29,12 +29,6 @@ fi
post_makeinstall_target() {
mkdir -p ${INSTALL}/usr/config/moonlight
cp -R ${PKG_BUILD}/moonlight.conf ${INSTALL}/usr/config/moonlight
if [ "${ARCH}" = "aarch64" ] && [ -n "${SPLASH_RESOLUTION}" ]; then
# Patch config file - stream in native screen resolution.
sed -i "s/#width = 1280/width = ${SPLASH_RESOLUTION%x*}/g" "${INSTALL}/usr/config/moonlight/moonlight.conf"
sed -i "s/#height = 720/height = ${SPLASH_RESOLUTION#*x}/g" "${INSTALL}/usr/config/moonlight/moonlight.conf"
fi
rm ${INSTALL}/usr/etc/moonlight.conf
rm ${INSTALL}/usr/share/moonlight/gamecontrollerdb.txt
rm ${INSTALL}/usr/etc/moonlight.conf
rm ${INSTALL}/usr/share/moonlight/gamecontrollerdb.txt
}

View file

@ -3,8 +3,8 @@
#address = 1.2.3.4
## Video streaming configuration
#width = 1280
#height = 720
width = @MWIDTH@
height = @MHEIGHT@
fps = 30
## Output rotation (independent of xrandr or framebuffer settings!)

View file

@ -21,27 +21,10 @@ make_target() {
mksplash() {
SPLASH="${ROOT}/distributions/${DISTRO}/splash/splash.png"
if [ -n "${SPLASH_RESOLUTION}" ]
then
# Switch the resolution so the rotated image will scale correctly.
HRES=$(echo "${SPLASH_RESOLUTION}" | awk 'BEGIN {FS="x"} {print $1}')
VRES=$(echo "${SPLASH_RESOLUTION}" | awk 'BEGIN {FS="x"} {print $2}')
if [ "${VRES}" -gt "${HRES}" ]
then
convert ${SPLASH} -quality 100 -background black -resize ${VRES}x${HRES} -gravity center -extent ${VRES}x${HRES} ${1}/splash.png
else
convert ${SPLASH} -quality 100 -background black -resize ${SPLASH_RESOLUTION} -gravity center -extent ${SPLASH_RESOLUTION} ${1}/splash.png
fi
convert ${SPLASH} -rotate 90 -quality 100 -background black -resize ${SPLASH_RESOLUTION} -gravity center -extent ${SPLASH_RESOLUTION} ${1}/splash_90.png
convert ${SPLASH} -rotate 180 -quality 100 -background black -resize ${SPLASH_RESOLUTION} -gravity center -extent ${SPLASH_RESOLUTION} ${1}/splash_180.png
convert ${SPLASH} -rotate 270 -quality 100 -background black -resize ${SPLASH_RESOLUTION} -gravity center -extent ${SPLASH_RESOLUTION} ${1}/splash_270.png
else
cp ${SPLASH} ${1}
convert ${SPLASH} -rotate 90 -quality 100 -background black -gravity center ${1}/splash_90.png
convert ${SPLASH} -rotate 180 -quality 100 -background black -gravity center ${1}/splash_180.png
convert ${SPLASH} -rotate 270 -quality 100 -background black -gravity center ${1}/splash_270.png
fi
cp ${SPLASH} ${1}
convert ${SPLASH} -rotate 90 -quality 100 -background black -gravity center ${1}/splash_90.png
convert ${SPLASH} -rotate 180 -quality 100 -background black -gravity center ${1}/splash_180.png
convert ${SPLASH} -rotate 270 -quality 100 -background black -gravity center ${1}/splash_270.png
}
makeinstall_init() {

View file

@ -45,9 +45,6 @@
# Define the CPU
HW_CPU="Amlogic S922x"
# Display Resolution
SPLASH_RESOLUTION="480x854"
# Mali GPU family
MALI_FAMILY="g52"
GRAPHIC_DRIVERS="panfrost"

View file

@ -45,9 +45,6 @@
# Additional kernel make parameters (for example to specify the u-boot loadaddress)
KERNEL_MAKE_EXTRACMD=" $(for DTB in "${DEVICE_DTB[@]}"; do echo -n "rockchip/${DTB}.dtb "; done)"
# Display Resolution
SPLASH_RESOLUTION="640x480"
# Define the CPU
HW_CPU="Rockchip RK3566"