Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

BashROMManager - Delete ROMs with your gamepad!



  • Hello fellows, happy carnevaling...

    As I saw that there could be demand of a method to delete ROMs via gamepad. Here it is the BashROMManger. Maybe some people will find it usefull.

    You can get it via instructions in code box.
    Or rush to my github account

    This little script let you delete determinated ROMs of choosen system. You can use your gamepad to delete ROMs, SaveStates, settings.....

    I tested with a system that contains more than 2000 entries and it did do it's job. So I think it can be introduced here :)
    Delete process is done via rm -f $romfile command

    As it is usable with your gamepad it can be annoying to click hundreds of files.
    Right to v.050 and higher it's possible to make multi selections!
    So this is a productive tool and it's more intended to delete setting files, single ROMs (broken, wrong translated, porn stuff, PD roms, twins....) in one session!

    How to install

    Copy the bashfile just into folder /home/pi/RetroPie/retropiemenu from your RetroPie installation.
    You "may" change the ROMPath if your have annother default setting as /home/pi/RetroPie/roms

    As the retropiemenu makes calls via bash there is no need to make this file executable. You can do this of course by typing chmod +x /home/pi/RetroPie/retropiemenu/BashROMManager.sh

    If you are not soooo familiar with unix system just enter the commands above

    wget https://raw.githubusercontent.com/crcerror/RetroPie-RPM-BashROMManager/master/BashROMManager.sh
    mv BashROMManager.sh ~/RetroPie/retropiemenu
    chmod +x ~/RetroPie/retropiemenu/BashROMManager.sh
    

    How does this work

    I wanted to write this as simple as possible.
    All directories from the your ROM-default path will be listed.

    So a typcial ROM structure usually can look like this

    ~/RetroPie
    |
    ├── roms
    │   ├── amstradcpc
    │   ├── arcade
    │   │   └── mame2003
    │   │       ├── cfg
    │   │       ├── ctrlr
    │   │       ├── diff
    │   │       ├── hi
    │   │       ├── inp
    │   │       ├── memcard
    │   │       ├── nvram
    │   │       └── snap
    │   ├── atari2600
    │   ├── atari7800
    │   ├── atarilynx
    │   ├── fba
    

    This looks awful... isn't it?

    So

    1. The shortnames atari2600, gb, nes will be displayed as their real names
      • cps1 >> Capcom Play System 1
      • nes >> Nintendo Entertainment system
      • gb >> Nintendo GameBoy
      • atari2600 >> Atari 2600.....
    2. Empty folder/systems will be ignored and can't be selected
    3. If a system contains subfolder the subfolder will also be ignored and can't be selected

    How does it looks now?

    1. You are in the system selection > zxspectrum selected
    img

    2. The zxspectrum system contains one file gamelist.xml
    img

    3. If I want to delete I'm asked if I want to do so
    img

    4. File is deleted as the folder is now empty zxspectrum will not be listed anymore
    img

    Updates to v.050

    1. Multi selection of files
    img

    2. Selected 4 files that are sended to queue
    img

    3. Wait! I don't want to delete a specific ROM, so I select it again - see the queue counter holds now only three items
    img

    Update to v.077

    Used FastForward two times and rushed 20% of gamelist
    img

    How to help?

    Improve the script!

    Greetings section

    @meleu and @hiulit for all the bash knoff hoff
    @pjft @Hex @mitu @mattrixk @madmodder123 @retroprogrammer @Yahmez @PokeEngineer @obsidianspider @mediamogul @jonnykesh



  • @cyperghost

    This will be very handy for me because I prefer using a controller than manually using a keyboard and messing in the file manager. Good job on this!



  • NICE!
    You are on a roll with the useful shell scripts :)



  • @madmodder123 @PokeEngineer
    Thanks you very much. But there are things to improve. I think instead of sending each file to it's specific delete command. It's better to send each file in a array. So we can make multiple selections! Without reloading the whole thing. Dialog supports multi select - but it's not possible to use with a gamepad :(



  • I'm proud to announce a full productive release (PR)

    v0.50 offers:

    • Quick file selection, as you don't jump back to position 1
    • Toggle file to delete queue (means you can remove it from deletion queue)
    • Some cosmetic improvements

    @PokeEngineer
    The way a file manager should work. Now you can select more than one file

    No worries - I ask with a YES/NO box per file before deletion

    Please give feedback!



  • Updates to v.050

    1. Multi selection of files
    img

    2. Selected 4 files that are sended to queue
    img

    3. Wait! I don't want to delete a specific ROM, so I select it again - see the queue counter holds now only three items
    img



  • Nice job (even if I prefer a ssh shell) :)
    To be as efficient as possible, maybe you could integrate (or launch afterward) @meleu cleanup scripts ?
    https://retropie.org.uk/forum/topic/11074/a-gamelist-xml-cleaner-tool/
    This way gamelists.xml files would be cleaned, and images and videos deleted as well.



  • @sano said in BashROMManager - Delete ROMs with your gamepad!:

    Nice job (even if I prefer a ssh shell) :)

    Yes or the Midnight Commander - but it's a pitty you don't have the possibility to remove some ROMs just with a controller. With a keyboard or via SSH-terminal you are 1000x times faster ;)

    To be as efficient as possible, maybe you could integrate (or launch afterward) @meleu cleanup scripts ?
    This way gamelists.xml files would be cleaned, and images and videos deleted as well.

    Well you are talking about being more efficinet with SSH ... ;)
    That's only possible with annother selection screen or textbox. It's a pitty you don't have "Space-key" within your controller to make radio buttons or selections lists work. That's the reason why I did that route with menu lists and counting items. But it works fast enough with an array that includes 2x 2500 entries (ARCADE system).

    But I've removed the FileManager within retropiemenu and replaced it with this script. This way is more usefull if you don't have a keyboard available! I also tried dialog --fselect but this option isn't good to handle with the limited key resources a gamepad input offers ;)

    So this script is (imho) a good replacement to work as little ROM-Maid ;)

    img



  • And a simple confirmation screen before deleting ?
    Do you want to also delete images, video and gamelist entries for the selected roms ? Yes/No



  • Well you are talking about being more efficinet with SSH ... ;)

    Ok, here you got me at least for gamelist cleanup, images/videos are simply handled with a one-liner ;)



  • @sano said in BashROMManager - Delete ROMs with your gamepad!:

    And a simple confirmation screen before deleting ?
    Do you want to also delete images, video and gamelist entries for the selected roms ? Yes/No

    Simple simple simple ;)
    Nothing is simple if you want a generic solution. Savegames are not always stored in ROMs directory. You can use this little script, from me to change SRM and SAVESTATE location for every system on the run ;) Works also nice as I now have folder %HOME%/RetroPie/savegames/$system symlinked to a USB drive.

    But you can investigate that script and see that it needs savegame pathes and system description. This can't be offered by a simple call by retropiemenu ;)



  • Simple for the user of course ;)

    I didn't talk about savegames but images and videos (potentially more space eating) are quite easy to find.

    An example for the image path of $rom on $system :
    xmlstarlet sel -T -t -c /gameList/game[path=\"$rom\"]/image -n .emulationstation/gamelists/$system/gamelist.xml



  • @sano Oh sorry ;)
    I do not use any scraper! So I'm not familiar with this. But it's no problem to expand the path the way you want....
    But SSH connection is the preferable solution here ;)



  • v 0.51 released

    Just some cosmetic effects

    • Better Handling of SUBDirectories
    • Resolved error that let's only select 9 items
    • MsgBox for wrong setted pathes
    • ....

    Enjoy



  • @cyperghost
    v.061 and v.077 are realeased

    Some cosmetic effects.
    We have now a 4 button layout
    Button 1 selects game to delete or removes them from delte queue
    Button 2 is the fast forward button
    Button 3 jumps back to system selection
    Button 4 is the begins the erase from queue

    Now wen can jump through gamelists
    The jump is calculated in depence of total entries of system

    So if a system contains 1000 Roms, then one jump is 100 entries
    Is it 100 roms then the jump is just 10 entries....

    If we reach the maximum of entries and select further FAST FORWARD then we will be set to first entry again!

    So the navigation through systems with massive entries is much much faster (faster then in ES!)

    So I think a 1.0 release isn't far away ;)
    So please report bugs and errors
    Send some PR if you want

    v.077

    Used FastForward two times and rushed 20% of gamelist
    img



Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.

Looks like your connection to RetroPie Forum was lost, please wait while we try to reconnect.