Skip to content

Instantly share code, notes, and snippets.

@omgmog omgmog/.jwmrc
Last active May 30, 2019

Embed
What would you like to do?
Generate list of games for JWM menu (http://joewing.net/projects/jwm/) on PocketCHIP
<!-- Example Menu in .jwmrc config-->
<!-- ... -->
<Menu label="GBA Games" icon="gba.png">
<Include>exec:$HOME/.scripts/gen_menu_items.sh gba vba</Include>
</Menu>
<Menu label="NES Games" icon="nes.png">
<Include>exec:$HOME/.scripts/gen_menu_items.sh nes nestopia</Include>
</Menu>
#!/bin/sh
romtype=${1}
emulator=${2}
echo "<JWM>"
find $HOME/Roms -type f -name "*.$romtype" -print0 |
while IFS= read -r -d '' r; do
echo "<Program label=\"$(basename "${r%.*}")\">$emulator \"$r\"</Program>"
done
echo "</JWM>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.