Ir-remote to run bash command

Hello!
I run OSMC on an rpi3 and control it with a harmony remote.
What I want to do is have the pi to listen to custom key presses eg “C-A-F1” and run a shell script when it detects it.
This is because I also have a Chromecast which I want to stop playing the current stream when the key is pressed.
As for now I have an old rpi with raspbian installed that does this trick but I would rather only have one pi running.

Does anyone know how I would achieve this?

// John

Probably best to map it to a single key than combination.
Then edit remote.xml or keyboard.xml and run a Python script via Kodi.

Thanks for the reply!
Since I am less than a novice in python and Linux do you have a suggestion to how the command in the .xml would look like?
Can I get it to run a system.exec() ?
// John

I figured it out :slight_smile:
I have a harmony one and a chinavasion (chinavision) MCE IR-remote an IR-receiver.

I created a keyboard.xml in “/home/osmc/.kodi/userdata/keymaps/” with this code:

The commands that I got to work are as above. I learnt them as “RAW” with the harmony remote.

The ccstop.py code is to stop my chromecast from streaming and the ccstart.py is to rickroll myself on youtube.

ccstop.py looks like this:

and ccstop.sh looks like this:

To get the chromecast to stop casting I first have to tell it to start youtube and then I can close the youtube app

//John