gpio-shutdown question

  • Hello, new to libreELEC.. new to PI in general. I've gotten my pi zero wh to boot and work with LibreELEC 9. I'm able to use the gpio-shutdown overlay to shutdown.. BUT it only prompts to shutdown... which requires input from me. Is there a way to make it do a shutdown that doesnt prompt (and that would let me start it back up via shorting pin 5 and 6)?

  • You need to create a /storage/.kodi/userdata/keymaps/keyboard.xml file with the following contents:

    Code
    <keymap>
      <global>
        <keyboard>
          <power>ShutDown()</power>
        </keyboard>
      </global>
    </keymap>

    The default kodi configuration is to show the shutdown menu.

    so long,

    Hias

  • I'm new to the whole linux thing.. mind going into a little more depth on what that does, and how it's modifying default behavior of kodi?

    Thanks, btw.. I appreciate the info, just trying to understand what I'm reading here..

  • Actually this is more of a Kodi thing than a Linux one. keyboard.xml is one of Kodi's configuration files where user settings are stored.

    Kodi first loads it's default configuration files (from /usr/share/kodi/system) and then the user config files (from /storage/.kod/userdata). The user config files can add new key mappings or override existing ones - we are doing the latter here, the default mapping for the power button is ActivateWindow(ShutdownMenu) - which brings up the shutdown menu.

    For more details have a look at the Kodi wiki: Keymap - Official Kodi Wiki

    PS: you can also change keyboard mapping with the "Keymap Editor" addon, but personally I find it a bit cumbersome to use. Creating the config files manually with an editor (nano or vi) isn't much more complicated, you see all changes you made without having to navigate through tons of submenus in the addon, and is even more flexible as you are not restricted to the functions/mappings the addon knows about.

    so long,

    Hias