[mythtv-users] Run a program from a key?

Michael T. Dean mtdean at thirdcontact.com
Mon Feb 6 21:39:12 UTC 2012

On 02/06/2012 04:01 PM, Kris B. wrote:
> On Mon, Feb 6, 2012, at 08:17 PM, Robert Longbottom wrote:
>> On 6 Feb 2012, at 07:32 PM, "Kris B." wrote:
>>> Sorry if this is a simple question - I can't seem to find the answer.
>>> I would love to have a keybinding to a function key to run an external
>>> program (my suspend script), so that my harmony remote on tv off can
>>> push that key for me and suspend my machine - right now it suspends
>>> after 1.5 hrs of inactivity if I am not watching a program (via
>>> xscreensaver), and I have my pause timer to kick out after 60 minutes.
>>> I also have the machine auto-suspend at 12:30AM if it hasn't already.
>>> This has helped regulate how much power I am using - but it would be
>>> cool if the machine suspended when I turn the tv off, also :)
>>> Is there a setting somewhere, or a config file where I can modify that?
>> I use irexec and a mapping in my lirc config file to achieve the same
>> thing using an rc6 ir remote control. Presumably you could do something
>> similar.
>> You need to have irexec running in the background as a daemon and the in
>> just executes the script.
>> begin
>>    prog = irexec
>>    button = KEY_POWER
>>    repeat = 0
>>    config = /home/mythtv/bin/suspend.sh
>> end
> The problem for me (and I should have mentioned before), is that I use
> an IR keyboard (airboard), so irexec isn't being used - it just plugs
> into the ps/2 keyboard spot.  So, I am pretty sure that won't work for
> me, though if I am wrong, please tell me...

Then you should probably set up Window Manager/Desktop Environment key 

MythTV has key bindings which map keys to MythTV actions and jump points 
which, basically, allow you to jump to a specific location in MythTV.

There is no support for running random scripts in response to keys (and, 
I don't think there's need for such with irexec and WM's/DE's already 
providing such support).  The only real benefit of allowing it would be 
that mythfrontend could set itself to ignore LIRC messages until the 
script/application finished executing, but better would be to add a 
generic approach for a script or application to tell mythfrontend to 
ignore LIRC messages until told to resume LIRC processing.  That way, 
the "ignore LIRC for a bit" functionality could be used with scripts 
that are triggered via irexec or key bindings or command prompt or ...


More information about the mythtv-users mailing list