kodi-send not working

  • I don't know what the hell I am doing wrong but when SSH'ing into LE 9.2 and trying to execute the following command

    Code
    1. kodi-send --action="Quit"

    it just gives me the following output

    Code
    1. Sending: {'content': 'Quit', 'type': 'action'}

    but then just nothing happens on the system itself.

    Allow remote control by programs on this/other systems are both enabled.

    Any ideas?

  • Okay I am now one step further, I just used the curl commands and got a working bash script.

    Now does somebody know how I can execute the script everytime and immediately after a user logs in? Is this even possible to set such a trigger?

  • You could use /storage/.profile to execute commands at ssh login time.

    Flexin' vinyl, jammin' break beats.:thumbup:

  • You could use /storage/.profile to execute commands at ssh login time.

    Nah, sorry for not being clear enough. I want the script to be executed everytime a user logs in via the LE GUI on TV, not when logging in via SSH.

  • Can you describe that login process a little more? I'm pushing the power button on my RPi, and that's the whole story.

    Flexin' vinyl, jammin' break beats.:thumbup:

  • Can you describe that login process a little more? I'm pushing the power button on my RPi, and that's the whole story.

    The login screen appears when you create different profiles. In my case for me, wy wife and my kids. Every user has its own profile with its own login.

    The problem is I cannot use autostart.sh as it runs the scripts before user login if I got this right.

  • Try with autoexec.py in user's profile folder. If users has different profile folders then you can have different autoexec.py script for every user and this script is executed after user is log in.


    Autoexec.py - Official Kodi Wiki

    Done giving support here because of last events.

  • Something like

    Code
    1. from subprocess import call
    2. call("/full/path/to/your/bash/script.sh")

    This solution worked, thank you.

    What I did, was:

    Create the autoexec.py directly inside the according profile folder with the following content:

    Code
    1. import subprocess
    2. subprocess.call("/storage/<myScriptFolder>/<myScript>.sh")

    Then made the autoexec.py executable by executing

    Code
    1. chmod +x autoexec.py