forked from woofmeow/straywild
fix: preserve PortMaster controller mappings through Weston
This commit is contained in:
parent
4cffe47ba3
commit
364e7dc282
4 changed files with 57 additions and 20 deletions
23
scripts/portmaster/launch-netfishing.sh
Executable file
23
scripts/portmaster/launch-netfishing.sh
Executable file
|
|
@ -0,0 +1,23 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [[ $# -lt 2 ]]; then
|
||||
echo "Usage: $0 <controller-mapping-file> <game-command> [arguments...]" >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
CONTROLLER_MAPPING_FILE="$1"
|
||||
shift
|
||||
|
||||
if [[ ! -r "$CONTROLLER_MAPPING_FILE" ]]; then
|
||||
echo "Controller mapping file is not readable: $CONTROLLER_MAPPING_FILE" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
SDL_GAMECONTROLLERCONFIG="$(<"$CONTROLLER_MAPPING_FILE")"
|
||||
if [[ "$SDL_GAMECONTROLLERCONFIG" != *,*,* ]]; then
|
||||
echo "Controller mapping file is malformed: $CONTROLLER_MAPPING_FILE" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
export SDL_GAMECONTROLLERCONFIG
|
||||
exec "$@"
|
||||
Loading…
Add table
Add a link
Reference in a new issue