Added copy of script to the source files and cleaned up readme
This commit is contained in:
30
taptaploot-forward.sh
Normal file
30
taptaploot-forward.sh
Normal file
@@ -0,0 +1,30 @@
|
||||
#!/bin/bash
|
||||
# Launches TapTapLoot in rootful Xwayland
|
||||
# Steam launch option: ~/.local/bin/taptaploot-forward.sh %command%
|
||||
|
||||
for i in $(seq 10 30); do
|
||||
if [ ! -e "/tmp/.X11-unix/X$i" ]; then
|
||||
GAME_DISPLAY=":$i"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
GAME_XAUTH=$(mktemp /tmp/taptaploot-xauth.XXXXXX)
|
||||
COOKIE=$(mcookie)
|
||||
xauth -f "$GAME_XAUTH" add "$GAME_DISPLAY" . "$COOKIE"
|
||||
|
||||
cleanup() {
|
||||
kill "$XWAYLAND_PID" 2>/dev/null
|
||||
wait "$XWAYLAND_PID" 2>/dev/null
|
||||
rm -f "$GAME_XAUTH"
|
||||
}
|
||||
trap cleanup EXIT INT TERM
|
||||
|
||||
XAUTHORITY="$GAME_XAUTH" Xwayland "$GAME_DISPLAY" -geometry 1920x1080 -noreset -auth "$GAME_XAUTH" &
|
||||
XWAYLAND_PID=$!
|
||||
sleep 1
|
||||
|
||||
DISPLAY="$GAME_DISPLAY" XAUTHORITY="$GAME_XAUTH" "$@" &
|
||||
GAME_PID=$!
|
||||
|
||||
wait "$GAME_PID"
|
||||
Reference in New Issue
Block a user