Files
Arch-R/scripts/opt-system/usb-mode.sh
Douglas Teles c8e7fe99e9 Add ES Tools menu scripts and gptokeyb configs (WIP)
Interactive tool scripts for EmulationStation's OPTIONS menu at /opt/system/:
system-info, wifi-setup, bluetooth-setup, performance-mode, suspend-mode,
usb-mode, factory-reset. Uses shared menu-lib.sh with fbcon rendering.

Gamepad configs: default.gptk (RetroArch), tools.gptk (menu navigation
with D-pad arrows, A=enter, B=escape).

Note: scripts need further testing on hardware — left disabled for now.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 17:22:49 -03:00

28 lines
717 B
Bash

#!/bin/bash
# NAME: USB Mode
. /usr/lib/archr/menu-lib.sh
tool_init
while true; do
if [ -d /sys/kernel/config/usb_gadget/archr ]; then
STATUS="Gadget (file transfer)"
else
STATUS="Host (default)"
fi
menu_select "USB Mode — Current: $STATUS" \
"Host Mode (USB devices)" \
"Gadget Mode (file transfer)" || break
case "$MENU_RESULT" in
0)
archr-usbgadget stop 2>/dev/null
msg_show "USB Mode" "Host mode enabled.\nConnect USB controllers or drives."
;;
1)
archr-usbgadget start 2>/dev/null
msg_show "USB Mode" "Gadget mode enabled.\nConnect USB cable to PC."
;;
esac
done