# Execute script from Remote Control button?

**URL:** <https://forums.plex.tv/t/execute-script-from-remote-control-button/107458>\
**Category:** Apps & Creations\
**Created:** [June 29, 2015, 7:19pm UTC](https://forums.plex.tv/t/execute-script-from-remote-control-button/107458 "2015-06-29T19:19:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sbussinger](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/sbussinger/32/98936_2.png) [@sbussinger](https://forums.plex.tv/u/sbussinger)\
**Post date:** [June 29, 2015, 7:19pm UTC](https://forums.plex.tv/t/execute-script-from-remote-control-button/107458/1 "2015-06-29T19:19:35Z")

</div>

I'm trying to figure out the RasPlex remote control stuff -- is there any way to have a button on the remote control run a shell script?

&nbsp;

I've figured out how to configure the remote control, but I'm not sure how to configure an action that executes a shell script (I want to send a custom cec-client command when the power button on the remote is pressed).

&nbsp;

Can anyone point me in the right direction? Thanks!

---

<div class="post-metadata">

**Author:** ![princebrand](https://avatars.discourse-cdn.com/v4/letter/p/e99b99/32.png) [@princebrand](https://forums.plex.tv/u/princebrand)\
**Post date:** [July 1, 2015, 6:46pm UTC](https://forums.plex.tv/t/execute-script-from-remote-control-button/107458/2 "2015-07-01T18:46:11Z")

</div>

Edit /storage/.plexht/userdata/keymaps/remote.xml

"yellow" is the name of CEC button

You can watch&nbsp;/storage/.plexht/temp/plexhometheater.log to see the pressed button names

You might need to enable logging via rasplex GUI.

You need to create python script for each action.

&nbsp; 

&nbsp; &nbsp; 

&nbsp; &nbsp; &nbsp; RunScript(/storage/.plexht/tv\_lights\_off.py)

&nbsp; &nbsp; 

&nbsp;

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [January 8, 2020, 7:01pm UTC](https://forums.plex.tv/t/execute-script-from-remote-control-button/107458/3 "2020-01-08T19:01:02Z")

</div>


