Settings Logo - With Background

Edit settings

A simple guide to editing launcher settings
Bit
07-11-2020
Settings Logo - With Background

The Kelboy launcher has evolved in such a way that the user does not have to change parameters in the code.

Initially the settings.py file inside the launcher core indicated these types of values, but currently the latest version has a configuration file in json format that can be edited by anyone.

The settings folder currently contains:

Image

We have talked about the first file in other articles, today we focus on the second (settings.json).

The content is as follows:

{
    "WIDTH": {
        "value": 640,
        "default": 320,
        "description": "default width resolution"
    },
    "HEIGHT": {
        "value": 480,
        "default": 240,
        "description": "screen height resolution"
    },
    "FRAMERATE": {
        "value": 60,
        "default": 60,
        "description": "framerate"
    },
    "margin": {
        "value": 10,
        "default": 10,
        "description": "general margin in pixels"
    },
    "SCREENSAVER_TIME": {
        "value": 6000,
        "default": 60000,
        "description": "trigger for screensaver in milliseconds"
    },
    "KEY_SLEEP": {
        "value": 0.02,
        "default": 0.02,
        "description": "time between key is pushed and launcher reacts"
    },
    "KEY_WHILE_SLEEP": {
        "value": 0.1,
        "default": 0.1,
        "description": "time before reacts while key is pressed for repeat action - like up or down"
    },
    "WIDGET_FRAMETIME": {
        "value": 200,
        "default": 200,
        "description": "refresh time for widgets"
    },
    "FONT_SIZE": {
        "value": 18,
        "default": 18,
        "description": "default font size"
    },
    "FONT_COLOR_ITEM": {
        "value": [
            255,
            255,
            255
        ],
        "default": [
            255,
            255,
            255
        ],
        "description": "default font color"
    },
    "FONT_TYPE": {
        "value": "resources/fonts/editundo_var.ttf",
        "default": "resources/fonts/editundo_var.ttf",
        "description": "default font type"
    },
    "FONT_TYPE_KEYBOARD": {
        "value": "resources/fonts/zeldadxt_mono.ttf",
        "default": "resources/fonts/zeldadxt_mono.ttf",
        "description": "default keyboard font type in keys"
    },
    "FONT_TYPE_KEYBOARDBAR": {
        "value": "resources/fonts/DejaVuSans.ttf",
        "default": "resources/fonts/DejaVuSans.ttf",
        "description": "default keyboard font type in string (keys pressed before press enter)"
    },
    "WPA_SUPPLICANT": {
        "value": "/etc/wpa_supplicant/wpa_supplicant.conf",
        "default": "/etc/wpa_supplicant/wpa_supplicant.conf",
        "description": "where is the wpa-supplicant in the system, must not be changed"
    },
    "UPLOAD_SITE": {
        "value": "https://github.com/lemoncrest/kelboy-launcher/archive/master.zip",
        "default": "https://github.com/lemoncrest/kelboy-launcher/archive/master.zip",
        "description": "default github download repository like zip"
    },
    "MAX_MENU_ITEMS": {
        "value": 10,
        "default": 10,
        "description": "max number of items in the menus"
    },
    "BACKGROUND_PICTURE": {
        "value": "background-br.png",
        "default": "background-br.png",
        "description": "this value configures the background image and must be stored in resources/graphics/"
    },
    "ROMS_PATH": {
        "value": "/home/pi/RetroPie/roms",
        "default": "/home/pi/RetroPie/roms",
        "description": "default roms path"
    },
    "FRAMES_IN": {
        "value": 16,
        "default": 16,
        "description": "number of frames for pixelate effect (out)"
    },
    "FRAMES_OUT": {
        "value": 16,
        "default": 16,
        "description": "number of frames for pixelate effect (out)"
    },
    "EVENT_DELAY_TIME": {
        "value": 1000,
        "default": 1000,
        "description": "default delay time"
    },
    "HORIZONTAL_MOVEMENT_REFRESH_FACTOR": {
        "value": 50,
        "default": 50,
        "description": "horizontal text movement effect in selected choice in menus, less is faster"
    },
    "HORIZONTAL_MOVEMENT_WAIT_TIME": {
        "value": 5,
        "default": 5,
        "description": "wait time for horizontal effect in seconds"
    },
    "BARSIZE": {
        "value": 25,
        "default": 25,
        "description": "up barsize (widgets) height in pixels"
    },
    "BATTERY_PERCENTAGE_CMD": {
        "value": "cat /sys/class/power_supply/max1726x_battery/capacity",
        "default": "cat /sys/class/power_supply/max1726x_battery/capacity",
        "description": "command for battery value, must not be changed"
    },
    "FUELGAUGE_CURRENT_CMD": {
        "value": "cat /sys/class/power_supply/max1726x_battery/current_now",
        "default": "cat /sys/class/power_supply/max1726x_battery/current_now",
        "description": "command for fuelgague status, should not be changed"
    },
    "AUDIO_CONTROL_CMD": {
        "value": "amixer | grep control | head -n 1 | awk -F' ' '{ print $4 }'",
        "default": "amixer | grep control | head -n 1 | awk -F' ' '{ print $4 }'",
        "description": "command for audio control with amixer"
    },
    "PICO8_BIN": {
        "value": "/home/pi/pico-8/pico8",
        "default": "/home/pi/pico-8/pico8",
        "description": "pico8 bin path"
    },
    "RETROARCH_BIN": {
        "value": "/opt/retropie/emulators/retroarch/bin/retroarch",
        "default": "/opt/retropie/emulators/retroarch/bin/retroarch",
        "description": "retroarch bin path"
    },
    "CONFIG_GB": {
        "value": "/opt/retropie/configs/gb/retroarch.cfg",
        "default": "/opt/retropie/configs/gb/retroarch.cfg",
        "description": "gb / gbc configuration"
    },
    "LIB_GB": {
        "value": "/opt/retropie/libretrocores/lr-gambatte/gambatte_libretro.so",
        "default": "/opt/retropie/libretrocores/lr-gambatte/gambatte_libretro.so",
        "description": "lib gb / gbc"
    },
    "CONFIG_GBA": {
        "value": "/opt/retropie/configs/gba/retroarch.cfg",
        "default": "/opt/retropie/configs/gba/retroarch.cfg",
        "description": "gba configuration"
    },
    "LIB_GBA": {
        "value": "/opt/retropie/libretrocores/lr-mgba/mgba_libretro.so",
        "default": "/opt/retropie/libretrocores/lr-mgba/mgba_libretro.so",
        "description": "lib gba"
    },
    "CONFIG_MD": {
        "value": "/opt/retropie/configs/megadrive/retroarch.cfg",
        "default": "/opt/retropie/configs/megadrive/retroarch.cfg",
        "description": "megadrive configuration"
    },
    "LIB_MD": {
        "value": "/opt/retropie/libretrocores/lr-genesis-plus-gx/genesis_plus_gx_libretro.so",
        "default": "/opt/retropie/libretrocores/lr-genesis-plus-gx/genesis_plus_gx_libretro.so",
        "description": "lib megadrive"
    },
    "LIB_N64": {
        "value": "/opt/retropie/libretrocores/lr-mupen64plus-next/mupen64plus_next_libretro.so",
        "default": "/opt/retropie/libretrocores/lr-mupen64plus-next/mupen64plus_next_libretro.so",
        "description": "nintendo 64 configuration"
    },
    "CONFIG_N64": {
        "value": "/opt/retropie/configs/n64/retroarch.cfg",
        "default": "/opt/retropie/configs/n64/retroarch.cfg",
        "description": "lib nintendo 64"
    },
    "CONFIG_AMSTRAD": {
        "value": "/opt/retropie/configs/amstradcpc/retroarch.cfg",
        "default": "/opt/retropie/configs/amstradcpc/retroarch.cfg",
        "description": "amstrad configuration"
    },
    "LIB_AMSTRAD": {
        "value": "/opt/retropie/libretrocores/lr-caprice32/cap32_libretro.so",
        "default": "/opt/retropie/libretrocores/lr-caprice32/cap32_libretro.so",
        "description": "lib amstrad"
    },
    "LIB_NES": {
        "value": "/opt/retropie/libretrocores/lr-fceumm/fceumm_libretro.so",
        "default": "/opt/retropie/libretrocores/lr-fceumm/fceumm_libretro.so",
        "description": "nes configuration"
    },
    "CONFIG_NES": {
        "value": "/opt/retropie/configs/nes/retroarch.cfg",
        "default": "/opt/retropie/configs/nes/retroarch.cfg",
        "description": "lib nes"
    },
    "LIB_SNES": {
        "value": "/opt/retropie/libretrocores/lr-snes9x2010/snes9x2010_libretro.so",
        "default": "/opt/retropie/libretrocores/lr-snes9x2010/snes9x2010_libretro.so",
        "description": "snes configuration"
    },
    "CONFIG_SNES": {
        "value": "/opt/retropie/configs/snes/retroarch.cfg",
        "default": "/opt/retropie/configs/snes/retroarch.cfg",
        "description": "lib snes"
    },
    "LIB_SNES_2010": {
        "value": "/opt/retropie/libretrocores/lr-snes9x2010/snes9x2010_libretro.so",
        "default": "/opt/retropie/libretrocores/lr-snes9x2010/snes9x2010_libretro.so",
        "description": "lib snes 2010"
    }
}

The way to develop these settings is designed so that each user can change the settings to their liking, by default it has values that the code inserts in case the parameter does not exist and that also follows as a guide to the user of the value that it previously had. As you can see, there is also a description that says what each parameter is.

These values are read in the launcher code, so they are the place to configure libraries and size parameters, letters ...

An example that we have been asked is how to change the wallpaper. The wallpapers are found in the resources / graphics folder of the launcher and are selected with the following configuration parameter:

"BACKGROUND_PICTURE": {
    "value": "background-br.png",
    "default": "background-br.png",
    "description": "this value configures the background image and must be stored in resources/graphics/"
}

You can select the one you want from the following, even add new ones in that folder:

Image

Launcher
This article is considered part of offered documentation by Lemoncrest products.
Comments
Page 1Page 1ear iconeye iconFill 23text filevr