How to execute a script by pressing a button on remote controller?

  • Hello,

    I installed LibreElec on my RPi3 and it works. I have also installed LIRC for remote controller, it works. I have a NAS (Network attached storage) on the same network. It wakes up with wol packets, so I wrote a script, it sends a wol packets every 3 minutes. The script runs on another linux machine. Now I want to copy this script to RPi and run it if I press a button on remote controller. I dont want to run script at start-up to avoid to start the NAS at every boot, I want to start the NAS only when needed.

    How can I do that? How can I "map" a button to a script?
    Thanks.

  • Thank you very much for your very very useful answer. But I forget to add that I can not use search, I don't know why.
    If I try to search something I get this error:

    Sorry, but you can only perform one search every 35 seconds. Please wait another 15 seconds before attempting to search again.

    But I don't try to search so often. I get this error even for first try.

  • Thank you very much for your very very useful answer. But I forget to add that I can not use search, I don't know why.
    If I try to search something I get this error:

    Sorry, but you can only perform one search every 35 seconds. Please wait another 15 seconds before attempting to search again.

    But I don't try to search so often. I get this error even for first try.


    You can start scripts from the keymaps.xml. f.i. if you want to start/stop hyperiond with the blue button:

    <b>System.Exec("/storage/.kodi/userdata/hyperion_switch.sh")</b>

    so, System.Exec is the command you are looking for