
YaYa already posted about it along with his amazing build + optimization guide, but i felt that i needed to post it too

I have made a simple program that reads an yaml file and "renders" (i really don't know if this is the right word) it as a menu, it looks like this right now:

just to clarify, that is not an emulationstation screen without theme, i plan to make it render just like the theme being used at ES, but that will take some time.
- I think we should be able to do (almost) everything using only the handheld, or at least the more things we can do with only it, the better.
- I think the retropie-setup menu (made with dialog) is ugly (don't get me wrong, i really like dialog, but it doesn't look right together with ES... it doesn't look "handheldish").
- I wanted to learn golang =P (i still want to be honest, lol).
Yes.

The only menu item type you can use right now (yeah, i plan to have more types at some point) is "run"... which means it will run something when you "click" it.
As an example, here is how "yayapoweroptimizations.yml" is right now (i'll probably update it soon with some more itens, but the idea is the same):
Code: Select all
---
name: "Yaya's power optimization"
options:
samba:
desc: "Samba - Enabled"
desc2: "Samba - Disabled"
cmd: "/home/pi/RetroPie-Setup/retropie_packages.sh samba depends remove"
undocmd: "/home/pi/RetroPie-Setup/retropie_packages.sh samba depends install && /home/retropie/RetroPie-Setup/retropie_packages.sh samba install_shares"
check: "test -r /etc/samba/smb.conf"
romservice:
desc: "ROMService (for USB keys) - Enabled"
desc2: "ROMService (for USB keys) - Disabled"
cmd: "/home/pi/RetroPie-Setup/retropie_packages.sh usbromservice enable"
undocmd: "/home/retropie/RetroPie-Setup/retropie_packages.sh usbromservice disable"
check: "test ! -r /opt/retropie/supplementary/usbromservice/disabled"
tv:
desc: "TV and HDMI signals - Enabled"
desc2: "TV and HDMI signals - Disabled"
cmd: "echo '/usr/bin/tvservice -o' >> /etc/rc.local && /usr/bin/tvservice -o"
undocmd: "sed -in -e '/tvservice -o/d' /etc/rc.local"
check: "grep -iq '/usr/bin/tvservice -o' /etc/rc.local"
pileds:
desc: "Pi status LEDs - Enabled"
desc2: "Pi status LEDs - Disabled"
cmd: "echo -e '# Disable pi status LED\ndtparam=act_led_trigger=none\ndtparam=act_led_activelow=on' >> /boot/config.txt"
undocmd: "sed -in -e '/# Disable pi status LED/,/dtparam=act_led_activelow=on/d' /boot/config.txt"
check: "grep -iq 'dtparam=act_led_trigger=none' /boot/config.txt"
sdperf:
desc: "SD performance - Default"
desc2: "SD performance - Improved"
cmd: "sed -in -e 's/elevator=deadline/elevator=noop/' /boot/cmdline.txt"
undocmd: "sed -in -e 's/elevator=noop/elevator=deadline/' /boot/cmdline.txt"
check: "grep -iq 'elevator=noop' /boot/cmdline.txt"
swap:
desc: "Swap - Default"
desc2: "Swap - Adjusted"
cmd: "echo 'vm.swappiness = 1' >> /etc/sysctl.conf"
undocmd: "sed -in -e '/vm.swappiness = 1/d' /etc/sysctl.conf"
check: "grep -iq 'vm.swappiness = 1' /etc/sysctl.conf"
tweakfs:
desc: "Tweak filesystem for fewer writes - Disabled"
desc2: "Tweak filesystem for fewer writes - Enabled"
cmd: "sed -i -re 's/(.*boot.*) defaults (.*)/\\1 defaults,noatime \\2/' /etc/fstab"
undocmd: "sed -i -re 's/(.*boot.*) defaults,noatime (.*)/\\1 defaults \\2/' /etc/fstab"
check: "grep -q 'boot.* defaults,noatime' /etc/fstab"
avahi:
desc: "Avahi service - Enabled"
desc2: "Avahi service - Disabled"
cmd: "systemctl disable avahi-daemon && systemctl stop avahi-daemon"
undocmd: "systemctl enable avahi-daemon && systemctl start avahi-daemon"
check: "! systemctl is-enabled avahi-daemon"
wifi:
desc: "WiFi - Enabled"
desc2: "WiFi - Disabled"
cmd: "echo -'# Disable wifi\ndtoverlay=pi3-disable-wifi' >> /boot/config.txt && ifdown wlan0"
undocmd: "sed -i '/# Disable wifi/,/dtoverlay=pi3-disable-wifi/d' /boot/config.txt && ifup wlan0"
check: "grep -q 'dtoverlay=pi3-disable-wifi' /boot/config.txt"
bluetooth:
desc: "Bluetooth - Enabled"
desc2: "Bluetooth - Disabled"
cmd: "echo -e '# Disable bluetooth\ndtoverlay=pi3-disable-bt' >> /boot/config.txt"
undocmd: "sed -i '/# Disable bluetooth/,/dtoverlay=pi3-disable-bt/d' /boot/config.txt"
check: "grep -q 'dtoverlay=pi3-disable-bt' /boot/config.txt"
Code: Select all
---
name: "Yaya's power optimization" <- title
options: <- so the code can identify the options (yeah, couldn't figure it out how to make them "root" itens)
samba: <- item name
desc: "Samba - Enabled" <- description of the item if check code returns something different from 0
desc2: "Samba - Disabled" <- description of the item if check code returns 0
cmd: "/home/pi/RetroPie-Setup/retropie_packages.sh samba depends remove" <- command to be run
undocmd: "/home/pi/RetroPie-Setup/retropie_packages.sh samba depends install && /home/retropie/RetroPie-Setup/retropie_packages.sh samba install_shares" <- command to undo what cmd does
check: "test -r /etc/samba/smb.conf" <- check code
If i make a new menu and want it to be shared with others, how do i make it so?
By default the menus are downloaded from this github repository: https://github.com/somatorio/gbz-menu-yamls you just need to make a Pull Request and wait for it to be merged

(i'm all open to a better way to do this, actually i'm all open to any ideas or helping)
Yada, yada, yada, i just want to use it... how do i install?
It's actually pretty simple, you can install it by running the following at your pi (using SSH, pluging a keyboard, etc.):
Code: Select all
curl -fsSL gbz-menu.somatorio.org | sudo sh
This installer is based on the one made for Docker (http://get.docker.com) =P and you can customize some settings using environment variables.
The ES theme it will use is a copy of your theme-set's game boy theme, just with the system logo replaced, feel free to customize it.

Please note that the menu YAML's will be shown as "roms", and the "emulator" will be gbz-menu (if i'm not mistaken the binary is called just "menu")...
I have a problem, how do i report it?
As much as i'll probably read it if you post it here at this thread, it's best if you post it here: https://github.com/somatorio/gbz-config-menu/issues as it will be easier to keep track.
