How to show kodi profile/login screen after resume from standby?

  • Hello, in order to keep my daughter from accessing kodi, I have set a password on the master profile and asked kodi to start up with the login/profile screen.
    But when I resume from standby, I am still logged into kodi.

    I guess this belongs here and not with kodi ... : how can I 'log out' of kodi when suspending, so that the login screen would be shown again at resume?
    Check this out: Profile Logon after resume from Standby . I need something similar that works with the current librelec version 8.

  • Code
    mkdir -p /storage/.config/sleep.d
    nano /storage/.config/sleep.d/01-logoff.sh
    Bash
    #!/bin/sh
    case "$1" in
      pre)
        kodi-send --action=System.LogOff
        ;;
      post)
        ;;
    esac


    and just for good measure

    Code
    dos2unix /storage/.config/sleep.d/01-logoff.sh

    Edited once, last by lrusak (December 11, 2016 at 6:37 AM).

  • Tnx! Unfortunately the script didn't get called. I think maybe it has something to do with how system.d works now in libreelec 8. I don't understand it very well.

    However I found something that works:

    Code
    cd .config/system.d
    cp /usr/lib/systemd/system/kodi-lirc-suspend.service kodi-profile-logoff.service

    Then simply change kodi-profile-logoff.service to something like this:

    Next, register the service

    Code
    systemctl enable kodi-profile-logoff.service

    Edited once, last by kdejaeger (December 11, 2016 at 10:28 AM).

  • @kdejaeger is this still working for you?

    I am using LE 9.2.0 but it doesn't work on my system.

    The kodi-send command is executed as can be seen from the output of "systemctl status":

    Code
    Mar 08 15:56:09 Macmini systemd[1]: Starting Actions before Kodi goes to sleep...
    Mar 08 15:56:10 Macmini kodi-send[929]: Sending: {'content': 'System.LogOff', 'type': 'action'}
    Mar 08 15:56:10 Macmini systemd[1]: Started Actions before Kodi goes to sleep.
    Mar 08 15:56:19 Macmini systemd[1]: kodi-sleep.service: Succeeded.
    Mar 08 15:56:19 Macmini systemd[1]: Stopped Actions before Kodi goes to sleep.

    However Kodi seems to ignore the System.LogOff command.

    Thanks,

    Jeroen