diff --git a/scriptmodules/supplementary/runcommand/runcommand.sh b/scriptmodules/supplementary/runcommand/runcommand.sh index d12ef436..217fec7b 100755 --- a/scriptmodules/supplementary/runcommand/runcommand.sh +++ b/scriptmodules/supplementary/runcommand/runcommand.sh @@ -77,23 +77,22 @@ ## pressed the GUI is shown, where a user can set video modes, default emulators ## and other options (depending what is being launched). -ROOTDIR="/opt/retropie" -CONFIGDIR="$ROOTDIR/configs" +CONFIGDIR="@sysCfgDir@" LOG="/dev/shm/runcommand.log" -RUNCOMMAND_CONF="$CONFIGDIR/all/runcommand.cfg" -VIDEO_CONF="$CONFIGDIR/all/videomodes.cfg" -EMU_CONF="$CONFIGDIR/all/emulators.cfg" -BACKENDS_CONF="$CONFIGDIR/all/backends.cfg" -RETRONETPLAY_CONF="$CONFIGDIR/all/retronetplay.cfg" -JOY2KEY="$ROOTDIR/admin/joy2key/joy2key" +RUNCOMMAND_CONF="@runcommandCfg@" +VIDEO_CONF="@videomodesCfg@" +EMU_CONF="@emulatorsCfg@" +BACKENDS_CONF="@backendsCfg@" +RETRONETPLAY_CONF="@retronetplayCfg@" +JOY2KEY="@joy2key@" # modesetting tools TVSERVICE="/opt/vc/bin/tvservice" -KMSTOOL="$ROOTDIR/supplementary/mesa-drm/modetest" -XRANDR="xrandr" +KMSTOOL="@modetest@" +XRANDR="@xrandr@" -source "$ROOTDIR/lib/inifuncs.sh" +source "@inifunc@" # disable the `patsub_replacement` shell option, it breaks the string substitution when replacement contains '&' if shopt -s patsub_replacement 2>/dev/null; then @@ -1109,8 +1108,8 @@ function retroarch_append_config() { fi # set `libretro_directory` to the core parent folder - local core_dir=$(echo "$COMMAND" | grep -Eo "$ROOTDIR/libretrocores/.*libretro\.so" | head -n 1) - core_dir=$(dirname "$core_dir") + local core_dir + core_dir="@libretroCores@" [[ -n "$core_dir" ]] && iniSet "libretro_directory" "$core_dir" # if verbose logging is on, set core logging to INFO @@ -1219,25 +1218,9 @@ function get_sys_command() { function show_launch() { local images=() - if [[ "$IS_SYS" -eq 1 && "$USE_ART" -eq 1 ]]; then - # if using art look for images in paths for es art. - images+=( - "$HOME/RetroPie/roms/$SYSTEM/images/${ROM_BN}-image" - "$HOME/.emulationstation/downloaded_images/$SYSTEM/${ROM_BN}-image" - "$HOME/.emulationstation/downloaded_media/$SYSTEM/screenshots/${ROM_BN}" - "$HOME/RetroPie/roms/$SYSTEM/media/screenshots/${ROM_BN}" - ) - fi - - # look for custom launching images - if [[ "$IS_SYS" -eq 1 ]]; then - images+=( - "$HOME/RetroPie/roms/$SYSTEM/images/${ROM_BN}-launching" - "$CONF_ROOT/launching" - ) - fi - [[ "$IS_PORT" -eq 1 ]] && images+=("$CONFIGDIR/ports/launching") - images+=("$CONFIGDIR/all/launching") + images+=( + "@imagesDir@/$SYSTEM/${ROM_BN}" + ) local image local path @@ -1267,7 +1250,7 @@ function show_launch() { else launch_name="$EMULATOR" fi - DIALOGRC="$CONFIGDIR/all/runcommand-launch-dialog.cfg" dialog --infobox "\nLaunching $launch_name ...\n\nPress a button to configure\n\nErrors are logged to $LOG" 9 60 + DIALOGRC="@runcommandLaunchDialogCfg@" dialog --infobox "\nLaunching $launch_name ...\n\nPress a button to configure\n\nErrors are logged to $LOG" 9 60 fi } @@ -1288,7 +1271,7 @@ function check_menu() { # calls script with parameters SYSTEM, EMULATOR, ROM, and commandline function user_script() { - local script="$CONFIGDIR/all/$1" + local script="@userscripts@/$1" if [[ -f "$script" ]]; then bash "$script" "$SYSTEM" "$EMULATOR" "$ROM" "$COMMAND" >"$LOG" fi