Skip to content

Instantly share code, notes, and snippets.

@Langerz82
Created October 8, 2025 14:22
Show Gist options
  • Save Langerz82/b2dde6ced6b1eb9fffa6c5a5fe959807 to your computer and use it in GitHub Desktop.
Save Langerz82/b2dde6ced6b1eb9fffa6c5a5fe959807 to your computer and use it in GitHub Desktop.
find_gamepad() {
local SDLJOYTEST="/tmp/emulation/amiberry/sdljoytest"
sdljoytest -skip_loop > ${SDLJOYTEST}
local GC_NAME=$(cat ${SDLJOYTEST} | grep "Joystick 0 name" | cut -d"'" -f2)
if [[ ! -z "${GC_NAME}" ]] && [[ -f "/tmp/joypads/${GC_NAME}.cfg" ]]; then
sed -i "s|joyport1_friendlyname=.*|joyport1_friendlyname=${GC_NAME}|" "$AMIBERRY_TMP_CONFIG"
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment