Guest - Testers are needed for the reworked CDateTime core component. See... https://forum.kodi.tv/showthread.php?tid=378981 (September 29) x
v20 User script does not execute with System.Exec
#1
Hi

I'm trying to execute a script when pressing a button on the remote.
Kodi detects the keypress but doesn't execute the script Sad

My script:
 
Code:
#!/bin/sh

/usr/bin/date >> /storage/.kodi/temp/test.txt
echo "TEST" >> /storage/.kodi/temp/test.txt

My keymap.
 
Code:
<keymap>
  <loginscreen><keyboard>
    <!-- leftmost red bar key -->
    <key id="251">System.Exec(/storage/bin/test.sh)</key>
    <!-- green bar key (next to red one) -->
    <key id="252">System.Exec(/storage/bin/test.sh)</key>
  </keyboard></loginscreen>
  <global><keyboard>
    <key id="50">contextmenu</key>
  </keyboard></global>
  <fullscreenvideo><keyboard>
    <key id="44">cyclesubtitle</key>
  </keyboard></fullscreenvideo>
  <filemanager><keyboard>
    <key id="50">contextmenu</key>
  </keyboard></filemanager>
</keymap>


Kodi log showing I pressed the button 3 times:
https://paste.kodi.tv/ayijitepev.kodi

the intesting part is
 
Code:
2023-04-29 19:22:45.457 T:27288 debug <general>: PushCecKeypress - received key fb duration 0
2023-04-29 19:22:45.465 T:27263 debug <general>: HandleKey: 251 (0xfb, obc4) pressed, window 10029, action is System.Exec('/bin/sh /storage/bin/test.sh')
2023-04-29 19:22:45.797 T:27288 debug <general>: PushCecKeypress - received key fb duration 340

If I execute the script from the shell with `/bin/sh /storage/bin/test.sh` it works fine.

How do I fix this?

Thanks
Reply
#2
Can anyone please help with this?

Thanks
Reply
#3
works fine for me mapped to F8, debian linux desktop, kodi 20.0 20230116-ec5b71680e (from january)

<F8>System.Exec(/path/to/script.sh)</F8>

make sure the script is executable - chmod +x /storage/bin/test.sh

and the target path /storage/.kodi/temp/test.txt is writeable
Reply

Logout Mark Read Team Forum Stats Members Help
User script does not execute with System.Exec0