diff --git a/com.xargon.retrodeck.yml b/com.xargon.retrodeck.yml index 6949c613..8977d2bb 100644 --- a/com.xargon.retrodeck.yml +++ b/com.xargon.retrodeck.yml @@ -35,6 +35,13 @@ cleanup: modules: + - name: kdialog + buildsystem: cmake + sources: + - type: git + url: https://github.com/KDE/kdialog.git + tag: v22.03.80 + # ES-DE - name: fdk-aac diff --git a/es_systems.xml b/es_systems.xml index 8b1f0026..eceb805c 100644 --- a/es_systems.xml +++ b/es_systems.xml @@ -1421,7 +1421,7 @@ tools RetroDECK Tools - %ROMPATH%/../tools/ + /var/config/retrodeck/tools .sh .SH ./%ROM% tools diff --git a/retrodeck-retroarch.cfg b/retrodeck-retroarch.cfg index 0586a9f6..eba81be8 100644 --- a/retrodeck-retroarch.cfg +++ b/retrodeck-retroarch.cfg @@ -74,15 +74,15 @@ cheevos_verbose_enable = "true" config_save_on_exit = "false" content_database_path = "/app/share/libretro/database/rdb" content_favorites_directory = "default" -content_favorites_path = "~/.var/app/com.xargon.retrodeck/config/retroarch/content_favorites.lpl" +content_favorites_path = "/var/config/retroarch/content_favorites.lpl" content_favorites_size = "200" content_history_directory = "default" -content_history_path = "~/.var/app/com.xargon.retrodeck/config/retroarch/content_history.lpl" +content_history_path = "/var/config/retroarch/content_history.lpl" content_history_size = "200" content_image_history_directory = "default" -content_image_history_path = "~/.var/app/com.xargon.retrodeck/config/retroarch/content_image_history.lpl" +content_image_history_path = "/var/config/retroarch/content_image_history.lpl" content_music_history_directory = "default" -content_music_history_path = "~/.var/app/com.xargon.retrodeck/config/retroarch/content_music_history.lpl" +content_music_history_path = "/var/config/retroarch/content_music_history.lpl" content_runtime_log = "true" content_runtime_log_aggregate = "false" content_show_add = "true" @@ -99,8 +99,8 @@ content_show_settings = "true" content_show_settings_password = "" content_show_video = "true" content_video_directory = "default" -content_video_history_path = "~/.var/app/com.xargon.retrodeck/config/retroarch/content_video_history.lpl" -core_assets_directory = "~/.var/app/com.xargon.retrodeck/config/retroarch/downloads" +content_video_history_path = "/var/config/retroarch/content_video_history.lpl" +core_assets_directory = "/var/config/retroarch/downloads" core_info_cache_enable = "true" core_option_category_enable = "true" core_options_path = "" @@ -2682,7 +2682,7 @@ input_recording_toggle_axis = "nul" input_recording_toggle_btn = "nul" input_recording_toggle_mbtn = "nul" input_remap_binds_enable = "true" -input_remapping_directory = "~/.var/app/com.xargon.retrodeck/config/retroarch/config/remaps" +input_remapping_directory = "/var/config/retroarch/config/remaps" input_reset = "h" input_reset_axis = "nul" input_reset_btn = "nul" @@ -2767,13 +2767,13 @@ keyboard_gamepad_mapping_type = "1" kiosk_mode_enable = "false" kiosk_mode_password = "" led_driver = "null" -libretro_directory = "/app/share/libretro/cores" +libretro_directory = "/var/config/retroarch/cores" libretro_info_path = "/app/share/libretro/info" libretro_log_level = "1" load_dummy_on_core_shutdown = "true" location_allow = "false" location_driver = "null" -log_dir = "~/.var/app/com.xargon.retrodeck/config/retroarch/logs" +log_dir = "/var/config/retroarch/logs" log_to_file = "false" log_to_file_timestamp = "false" log_verbosity = "false" @@ -2823,7 +2823,7 @@ menu_scroll_fast = "false" menu_shader_pipeline = "2" menu_show_advanced_settings = "false" menu_show_configurations = "true" -menu_show_core_updater = "true" +menu_show_core_updater = "false" menu_show_dump_disc = "true" menu_show_help = "true" menu_show_information = "true" @@ -2833,7 +2833,7 @@ menu_show_load_content = "true" menu_show_load_content_animation = "false" menu_show_load_core = "true" menu_show_load_disc = "true" -menu_show_online_updater = "true" +menu_show_online_updater = "false" menu_show_overlays = "true" menu_show_quit_retroarch = "true" menu_show_reboot = "true" @@ -2954,7 +2954,7 @@ ozone_truncate_playlist_name = "true" pause_nonactive = "true" perfcnt_enable = "false" playlist_compression = "false" -playlist_directory = "~/.var/app/com.xargon.retrodeck/config/retroarch/playlists" +playlist_directory = "/var/config/retroarch/playlists" playlist_entry_remove_enable = "1" playlist_entry_rename = "true" playlist_fuzzy_archive_match = "false" @@ -2993,8 +2993,8 @@ quick_menu_show_undo_save_load_state = "true" quit_on_close_content = "0" quit_press_twice = "true" record_driver = "ffmpeg" -recording_config_directory = "~/.var/app/com.xargon.retrodeck/config/retroarch/records_config" -recording_output_directory = "~/.var/app/com.xargon.retrodeck/config/retroarch/records" +recording_config_directory = "/var/config/retroarch/records_config" +recording_output_directory = "/var/config/retroarch/records" resampler_directory = "" rewind_buffer_size = "20971520" rewind_buffer_size_step = "10" @@ -3006,7 +3006,7 @@ rgui_background_filler_thickness_enable = "true" rgui_border_filler_enable = "true" rgui_border_filler_thickness_enable = "true" rgui_browser_directory = "default" -rgui_config_directory = "~/.var/app/com.xargon.retrodeck/config/retroarch/config" +rgui_config_directory = "/var/config/retroarch/config" rgui_extended_ascii = "false" rgui_inline_thumbnails = "false" rgui_internal_upscale_level = "0" @@ -3078,10 +3078,10 @@ stdin_cmd_enable = "false" streaming_mode = "0" suspend_screensaver_enable = "true" sustained_performance_mode = "false" -system_directory = "~/.var/app/com.xargon.retrodeck/config/retroarch/system" +system_directory = "/var/config/retroarch/system" systemfiles_in_content_dir = "false" threaded_data_runloop_enable = "true" -thumbnails_directory = "~/.var/app/com.xargon.retrodeck/config/retroarch/thumbnails" +thumbnails_directory = "/var/config/retroarch/thumbnails" twitch_stream_key = "" ui_companion_enable = "false" ui_companion_start_on_boot = "true" @@ -3121,7 +3121,7 @@ video_hdr_enable = "false" video_hdr_expand_gamut = "true" video_hdr_max_nits = "1000.000000" video_hdr_paper_white_nits = "200.000000" -video_layout_directory = "~/.var/app/com.xargon.retrodeck/config/retroarch/layouts" +video_layout_directory = "/var/config/retroarch/layouts" video_layout_enable = "true" video_layout_path = "" video_layout_selected_view = "0" diff --git a/retrodeck.sh b/retrodeck.sh index 5123f7b2..bcd17d39 100644 --- a/retrodeck.sh +++ b/retrodeck.sh @@ -1,28 +1,56 @@ #!/bin/bash +# Steam Deck SD path: /run/media/mmcblk0p1 + +is_mounted() { + mount | awk -v DIR="$1" '{if ($3 == DIR) { exit 0}} ENDFILE{exit -1}' +} + # if we got the .lock file it means that it's not a first run if [ ! -f ~/retrodeck/.lock ] then - mkdir -p ~/retrodeck/.emulationstation - rm -rf ~/retrodeck/.emulationstation/es_settings.xml - rm -rf ~/retrodeck/.emulationstation/es_input.xml - cp /app/retrodeck/es_settings.xml ~/retrodeck/.emulationstation/es_settings.xml - cp /app/retrodeck/es_settings.xml ~/retrodeck/.emulationstation/es_input.xml + internal=`kdialog --title "RetroDECK" -- yes-label "Internal" --no-label "SD Card" --yesno "Where do you want your rom folder to be located?"` + if $internal #yes - Internal + then + roms_folder=~/retrodeck/roms + else #no - SD Card + if is_mounted "/run/media/mmcblk0p1" + then + roms_folder=/run/media/mmcblk0p1/retrodeck/roms + else + kdialog --title "RetroDECK" --error "SD Card is not readable, please check if it inserted or mounted correctly and run RetroDECK again." + exit 0 + fi + fi + mkdir -p $roms_folder + rm -rf /var/config/.emulationstation/ROMs + rm -rf /var/config/.emulationstation/roms + ln -s $roms_folder /var/config/.emulationstation/roms + kdialog --Title "RetroDECK" --msgbox "Done, please put your roms in: $roms_folder. In order to change location you may use the tool provided in the tools section of RetroDECK." + + mkdir -p /var/config/.emulationstation + rm -rf /var/config/.emulationstation/es_settings.xml + rm -rf /var/config/.emulationstation/es_input.xml + cp /app/retrodeck/es_settings.xml /var/config/.emulationstation/es_settings.xml + cp /app/retrodeck/es_settings.xml /var/config/.emulationstation/es_input.xml mkdir -p ~/retrodeck/saves mkdir -p ~/retrodeck/states mkdir -p ~/retrodeck/screenshots - mkdir -p ~/retrodeck/tools - cp -r /app/retrodeck/tools/* ~/retrodeck/tools/ + mkdir -p /var/config/retrodeck/tools + cp -r /app/retrodeck/tools/* /var/config/retrodeck/tools mkdir -p /var/config/retroarch/system ln -s ~/.var/app/com.xargon.retrodeck/config/retroarch/system/ ~/retrodeck/bios cp /app/retrodeck/retrodeck-retroarch.cfg /var/config/retroarch/retroarch.cfg - mkdir -p ~/retrodeck/.emulationstation/gamelists/tools/ - cp /app/retrodeck/tools-gamelist.xml ~/retrodeck/.emulationstation/gamelists/tools/gamelist.xml + mkdir -p /var/config/.emulationstation/gamelists/tools/ + cp /app/retrodeck/tools-gamelist.xml /var/config/.emulationstation/gamelists/tools/gamelist.xml + + mkdir -p /var/config/retroarch/cores/ + cp /app/share/libretro/cores/* /var/config/retroarch/cores/ touch ~/retrodeck/.lock fi @@ -35,4 +63,4 @@ fi # fi #done -emulationstation --home ~/retrodeck/ \ No newline at end of file +emulationstation --home /var/config/ \ No newline at end of file diff --git a/tools-gamelist.xml b/tools-gamelist.xml index 272ee9eb..4a691c46 100644 --- a/tools-gamelist.xml +++ b/tools-gamelist.xml @@ -1,7 +1,7 @@ - ./start-retroarch.sh + start-retroarch.sh Start RetroArch RetroArch RetroArch is a frontend for emulators, game engines and media players. diff --git a/tools/start-retroarch.sh b/tools/start-retroarch.sh index df2f7a9a..bfd5bbc0 100644 --- a/tools/start-retroarch.sh +++ b/tools/start-retroarch.sh @@ -1,3 +1,5 @@ #!/bin/bash -retroarch \ No newline at end of file +yousure=kdialog --title "RetroDECK" --warningyesno "Doing some changes in the RetroArch configuration may create serious issues, please continue only if you know what you're doing. Are you sure do you want to continue?" +if $yousure then + retroarch \ No newline at end of file