Page 1 of 1

Shell scripts for re-orging dirs/items for "clarity"

Posted: Sun Jan 16, 2022 3:57 pm
by edr
=> Inspect any scripts before you run them :)

I've been tweaking for some months a few simple shell scripts to re-org dirs & items based on my own prefs
- Rename some console cores to similar name lengths & hide console cores I don't use
- Rename some of the "Other" cores, with shorter names of similar lengths
- Rename InputTest utility to InpTest to make name same length as the other two
- Move Palettes to their own dir so they don't show up in my game dirs when loading games
- Change altname for NeoGeo games I play to use "normal" numbering and shorter lengths

Any re-org needs to be undone before running an updater (downloader.sh or update.sh), otherwise the updater will re-download missing items over and over. So I'm using a "reorg_off.sh" script to undo any changes before the updater runs, and a "reorg_on.sh" script to do the reorg after the updater runs. I trigger everything using a short "all_updates.sh" script which undoes changes, runs updates, then re-does changes. And bc it's called all_updates it's the first script in the Scripts dir and easy to run using a controller from the MiSTer menu.

reorg_off.sh.zip
(723 Bytes) Downloaded 178 times
reorg_on.sh.zip
(1.61 KiB) Downloaded 177 times
all_updates.sh.zip
(309 Bytes) Downloaded 185 times
After the re-org is done, the dirs will look similar to:

_Arcade/
  • cores/
  • disabled/
    • _alternatives/
    • _default/
_Console/
  • disabled/
  • GameBoy 1_20211121.rbf
  • GameBoy Adv_20211201.rbf
  • Genesis 1_20220105.rbf
  • Genesis CD_20211214.rbf
  • Master Sys_20210930.rbf
  • Neo Geo Mvs_20220105.rbf
  • NES Famicom_20211214.rbf
  • PlayStation_20211219.rb
  • Super NES_20220105.rbf
  • TurboGrafx_20220105.rb
_Other/
  • Arduboy_20210113.rbf
  • Chess_20200827.rbf
  • Chip8_20200208.rbf
  • Flappy_20200402.rbf
  • Galaxy_20200818.rbf
  • Life_20200430.rbf
  • Scramble_20200724.rbf
Palettes/
  • GAMEBOY
  • GAMEBOY2P
  • NES
_Utility/
  • AdcTest_20201231.rbf
  • InpTest_20211127.rbf
  • MemTest_20210130.rbf
I know the mister org might change over time, or maybe /media/fat won't always be the location for everything, so will need to tweak the scripts when anything changes.

In addition to the reorg scripts, I also manually organized my game dirs similar to the below, since I like short titles and like having only the games that I play showing up, not thousands of unused entries and hacks.

_Arcade
  • _Action
    • Altered Beast.mra
    • Frogger.mra
    • Pac-Man 1.mra
  • _Adventure
    • ...etc...
  • _Beatemup
  • cores
  • disabled
  • _Driving
  • _Fighting
  • _Platform
  • _Puzzle
  • _Rungun
  • _Shooter
  • _Sports
games
NES
  • Action
    • Balloon Fight.nes
    • Guardian Legend.nes
    • Joust.nes
  • Adventure
    • ...etc...
  • boot0.rom
  • Fighting
  • Platform
  • Puzzles
  • Racing
  • README.md
  • Roleplay
  • Rungun
  • Shooter
  • Sports

Re: Shell scripts for re-orging dirs/items for "clarity"

Posted: Mon Jan 17, 2022 4:09 pm
by Brs
Thanks. This helped me get started to easily add my own organization. I moved the computer and other directories to a different directory so they don’t show up and changed the selected consoles a bit. I didn’t do the renaming, palette stuff, and kept the arcade cores.

Re: Shell scripts for re-orging dirs/items for "clarity"

Posted: Wed Feb 23, 2022 10:15 pm
by porjay
Thanks for sharing this. I haven't personally used it but I do like the idea. Great work!

Re: Shell scripts for re-orging dirs/items for "clarity"

Posted: Thu Feb 24, 2022 2:24 pm
by Sigismond0
- Rename some console cores to similar name lengths & hide console cores I don't use
- Rename some of the "Other" cores, with shorter names of similar lengths
- Rename InputTest utility to InpTest to make name same length as the other two
Renaming can just be done by editing your names.txt file, which should be preferable to actually editing file names over and over. And for any cores you don't like, you can just filter them out with the updater's filter feature. Additionally, Neo Geo games are much easier to manage if you just use .NEO format instead of Darksoft format. No need for ROMSET.xml and it just displays the filename.

Reorganizing is something that you used to be able to do with the old updater, but was lost with the new one. For me, I really like having all consoles in the root directory, and I can definitely get behind something to help automate that.

Attached is a edit of the scripts that only takes the RBFs in _Console and moves them to /media/fat, then deletes the _Console directory. The undo script will move the console cores in /media/fat back to _Console. The all_update script has been edited to use the update_all script instead of just the downloader. Nothing else is edited or changed

Note: To ensure no mistakes happen, I'm singling out every console by name instead of just doing *.rbf. I don't download a number of console cores like Astrocade or Emerson Arcadia, so those are commented out. Edit to match your own cores if needed.

Re: Shell scripts for re-orging dirs/items for "clarity"

Posted: Sat Mar 12, 2022 5:15 pm
by Sigismond0
Upgraded my scripts, attached for anyone that wants them. Now they put symlinks in the root instead of moving RBFs, and leave the _Console folder entirely intact. This allows MiSTer_SAM to work, among other things. Just edit the script to do the cores you want "favorited" on the homescreen.