makedeb
A tribute to Nintendo's The Legend of Zelda (NES), read install instructions in README.pkg
Viewing /zelda-classic-workaround.sh
.
Click here to go back to the Git tree for zelda-classic-bin.
#!/bin/sh
#
# Zelda Classic bug workaround - (c) exponential 2022
#SKIP="true"
#
SKIP="false"
if [ "$SKIP" = "false" ] && [ -n "$(command -v Xephyr 2>/dev/null)" ]; then
if echo "$@" | grep -q -- "-fullscreen" 2>/dev/null || echo "$@" | grep -vq -- "-windowed" 2>/dev/null && cat "ag.cfg" | grep "^fullscreen" | tail -n 1 | grep -q "1" 2>/dev/null ; then
screen="$(xrandr -q | grep '*' | sed 's/^\s*//' | sed 's/\s.*$//')"
fullscreen="-fullscreen"
else
if echo "$@" | grep -q "-windowed" 2>/dev/null ; then
screen="$(echo ""$@"" | sed 's!.*res \([0-9]*\) \([0-9]*\).*!\1x\2!')"
else
screenx="$( cat ag.cfg | grep resx | sed 's/resx *= *\([0-9]*\).*/\1/')"
screeny="$( cat ag.cfg | grep resy | sed 's/resy *= *\([0-9]*\).*/\1/')"
screen="${screenx}x${screeny}"
fi
fi
Xephyr -br $fullscreen -reset -terminate -screen "$screen" :10 &
DISPLAY=:10 exec /usr/libexec/zelda-classic/zelda-l.real "$@"
else
exec /usr/libexec/zelda-classic/zelda-l.real "$@"
fi