Dual-screen mode across all devices

This commit is contained in:
tiopex
2025-11-04 22:34:37 +01:00
parent 1de08a5ae7
commit 077b740afd
10 changed files with 26 additions and 19 deletions

View File

@@ -40,15 +40,6 @@ if [ "${HW_DEVICE}" = "RK3588" ] && [ ! -f "${CONF_FILE}" ]; then
fi
fi
# Move the secondary window to the second output
if [ "${DEVICE_HAS_DUAL_SCREEN}" = "true" ]; then
# Ensure separate windows rule exists
if ! grep -qE '^for_window \[app_id="org.azahar_emu.Azahar" title=".*Secondary Window.*"\] move window to output DSI-1$' "${SWAY_CONFIG}"; then
echo 'for_window [app_id="org.azahar_emu.Azahar" title=".*Secondary Window.*"] move window to output DSI-1' >> "${SWAY_CONFIG}"
swaymsg reload
fi
fi
# Make sure QT config file exists
[ ! -f "${CONF_FILE}" ] && cp ${IMMUTABLE_CONF_DIR}/qt-config.ini ${CONF_DIR}

View File

@@ -65,6 +65,9 @@ ScreenGap=0
ScreenLayout=2
ScreenSwap=1
ScreenSizing=0
Screen1Layout=2
Screen1Enabled=false
Screen1Sizing=5
IntegerScaling=0
ScreenAspectTop=0
ScreenAspectBot=0

View File

@@ -65,6 +65,9 @@ ScreenGap=0
ScreenLayout=2
ScreenSwap=1
ScreenSizing=0
Screen1Layout=2
Screen1Enabled=false
Screen1Sizing=5
IntegerScaling=0
ScreenAspectTop=0
ScreenAspectBot=0

View File

@@ -65,6 +65,9 @@ ScreenGap=0
ScreenLayout=2
ScreenSwap=0
ScreenSizing=3
Screen1Layout=2
Screen1Enabled=false
Screen1Sizing=5
IntegerScaling=0
ScreenAspectTop=0
ScreenAspectBot=0

View File

@@ -65,6 +65,9 @@ ScreenGap=0
ScreenLayout=2
ScreenSwap=0
ScreenSizing=1
Screen1Layout=2
Screen1Enabled=false
Screen1Sizing=5
IntegerScaling=0
ScreenAspectTop=0
ScreenAspectBot=0

View File

@@ -65,6 +65,9 @@ ScreenGap=0
ScreenLayout=2
ScreenSwap=0
ScreenSizing=0
Screen1Layout=2
Screen1Enabled=false
Screen1Sizing=5
IntegerScaling=0
ScreenAspectTop=0
ScreenAspectBot=0

View File

@@ -65,6 +65,9 @@ ScreenGap=0
ScreenLayout=2
ScreenSwap=1
ScreenSizing=0
Screen1Layout=2
Screen1Enabled=false
Screen1Sizing=5
IntegerScaling=0
ScreenAspectTop=0
ScreenAspectBot=0

View File

@@ -29,15 +29,6 @@ if [ ! -f "${CONF_DIR}/melonDS.gptk" ]; then
cp -r "/usr/config/melonDS/melonDS.gptk" "${CONF_DIR}/melonDS.gptk"
fi
# Move the secondary window to the second output
if [ "${DEVICE_HAS_DUAL_SCREEN}" = "true" ]; then
# Ensure separate windows rule exists
if ! grep -qE '^for_window [class="melonDS" title=".*\[w2\]*"] move window to output DSI-1$' "${SWAY_CONFIG}"; then
echo 'for_window [class="melonDS" title=".*\[w2\]*"] move window to output DSI-1' >> "${SWAY_CONFIG}"
swaymsg reload
fi
fi
#Emulation Station Features
GAME=$(echo "${1}" | sed "s#^/.*/##")
PLATFORM=$(echo "${2}"| sed "s#^/.*/##")

View File

@@ -2,7 +2,7 @@
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2024 ROCKNIX (https://github.com/ROCKNIX)
count=$(modetest | awk '$3=="connected" && $4 ~ /^DSI/ {print $0}' | wc -l)
count=$(modetest | awk '$3 == "connected" {print $0}' | wc -l)
if [ "$count" -eq 2 ]; then
dual_screen=true

View File

@@ -37,6 +37,7 @@ echo "WLR_BACKENDS=drm,libinput" >> ${env_file}
# Scan connectors
card=/sys/class/drm/card${card_no}
connected_cons=()
for connector in ${card}/card${card_no}*/
do
status=$(cat ${connector}/status)
@@ -49,6 +50,7 @@ do
# Simply prioritize later connectors, meaning HDMI/DP priority
con=$(basename $connector)
con=${con: +6}
connected_cons+=("$con")
fi
done
@@ -102,3 +104,8 @@ if hexdump -C /sys/class/drm/card0-DP-1/edid | grep -q "Lontium"; then
echo "input \"8746:1:RetroidPocket_RDS_Touchscreen\" map_to_output DP-1" >> $SWAY_HOME/config
echo "input \"8746:1:RetroidPocket_RDS_Touchscreen\" calibration_matrix 0 1 0 -1 0 1" >> $SWAY_HOME/config
fi
# Move the secondary window to the second output
if [ "${DEVICE_HAS_DUAL_SCREEN}" = "true" ]; then
echo 'for_window [title=".*(Secondary|\[w2\]|Sub|Bottom|Screen 2|GamePad).*"] move window to output '"${connected_cons[0]}" >> $SWAY_HOME/config
fi