Difference between revisions of "Customized Remote Control Keys"
m (Keys- customized, and hints and tips moved to Keys- customized remote control keys: better title) |
(→Customised keys) |
||
Line 32: | Line 32: | ||
From PaulPick in the mythtv mailing list. | From PaulPick in the mythtv mailing list. | ||
+ | |||
+ | ==== Configuring the power button to do DPMS sleep/unsleep ==== | ||
+ | |||
+ | DPMS is useful for avoiding burned-in screen. Most people do not want to use DPMS or screensavers because you need to press a key on the keyboard or move the mouse to wake up the screen once DPMS activates. This is painful if a remote control is normally used to control Mythtv. If you configure the power button on the remote to toggle DPMS on or off then you can avoid burned-in screens. | ||
+ | |||
+ | LIRC can be configured to wake up the Mythtv display from DPMS screen blanking. This is done using a script via irexec. The same button can also be used to make the display go to sleep. | ||
+ | |||
+ | First edit the ~/.lircrc file to include the following stanza. A good Howto and MCE .lircrc file for Fedora Core 4 or 5 you can find here [http://www.netreveal.com/ddalton/2006/04/htpc_remote_on_fedora_core_4_o_1.html]: | ||
+ | |||
+ | <code> | ||
+ | begin | ||
+ | prog = irexec | ||
+ | button = Power | ||
+ | repeat = 3 | ||
+ | config = /usr/local/bin/mythpowerbutton.sh | ||
+ | #config = Key Alt-Escape CurrentWindow | ||
+ | end | ||
+ | </code> | ||
+ | |||
+ | Note that we need irexec running to make this all work. For me this was done via the myth-load.sh script, detailed in the main HOWTO Jarod Wilson has written [http://www.wilsonet.com/mythtv]. | ||
+ | |||
+ | Created a shell script in <i>/usr/local/bin/</i>, called <i>mythpowerbutton.sh</i>. Thanks to Yeechang Lee for this script [http://www.gossamer-threads.com/lists/mythtv/users/208553?search_string=My%20experience%20with%20mythtv;#208553]: | ||
+ | |||
+ | <code> | ||
+ | #!/bin/sh | ||
+ | |||
+ | if [ `cat /tmp/mythsleeptogglestatus` == "off" ] | ||
+ | then | ||
+ | xset dpms force on; | ||
+ | echo "on" > /tmp/mythsleeptogglestatus | ||
+ | else | ||
+ | sleep 1; | ||
+ | xset dpms force off; | ||
+ | echo "off" > /tmp/mythsleeptogglestatus | ||
+ | fi | ||
+ | </code> | ||
+ | |||
+ | (This script might be able to be modified to not rely on a temp file, it could use xset to list DPMS status and toggle it?) | ||
+ | |||
+ | Make the script executable. | ||
+ | |||
+ | <code> | ||
+ | chmod a+x /usr/local/bin/mythpowerbutton.sh | ||
+ | </code> | ||
+ | |||
+ | Then | ||
+ | |||
+ | <code> | ||
+ | echo $PATH | ||
+ | </code> | ||
+ | |||
+ | and make sure <i>/usr/local/bin</i> is in the list. If not you will have to add it to /etc/??? (???- fix this!) and either log out and back in or start up irexec manually to see it function. If there are any other sections in the <i>~/.lircrc</i> file that are associated with the POWER button, then they should be removed or you may see multiple things happen at once. | ||
+ | |||
+ | Now when the Power button on the remote is pressed, the screen should blank (DPMS on) and with one more press the Mythtv GUI should reappear (DPMS off). | ||
+ | |||
+ | This section originally appeared in [[MCE Remote]]. | ||
+ | |||
--[[User:Indulis|indulis]] 04:48, 3 October 2006 (UTC) | --[[User:Indulis|indulis]] 04:48, 3 October 2006 (UTC) | ||
[[Category:Remote Controls]] | [[Category:Remote Controls]] |
Revision as of 07:01, 3 October 2006
Contents
Remote Control Keys- hints, tips etc
Tips, Hints, and customised keys for remote controls
This page documents remote control tips, hints, and customised remote control keys. These are generally applicable to all remote control setups. For setup steps and customisations specific to a particular type of remote control see ???
Customised keys
Restart Mythtv key
Give the mythtv user permission to restart mythtv via sudo. Edit /etc/sudoers and add the following line:
mythtv ALL=NOPASSWD: /etc/init.d/mythbackend
If you are running mythtv as a different user you will change mythtv to the user name you are using.
This sets up sudo so that user mythtv can do "sudo /etc/init.d/mythbackend restart".
Add something like this to the lircrc file in your ~/.mythtv directory e.g. if user fred runs mythtv on your system this would be /home/fred/.mythtv/lircrc:
# Power Off/Exit begin prog = irexec button = OFF config = /script/to/re-cycle/everything end
From PaulPick in the mythtv mailing list.
Configuring the power button to do DPMS sleep/unsleep
DPMS is useful for avoiding burned-in screen. Most people do not want to use DPMS or screensavers because you need to press a key on the keyboard or move the mouse to wake up the screen once DPMS activates. This is painful if a remote control is normally used to control Mythtv. If you configure the power button on the remote to toggle DPMS on or off then you can avoid burned-in screens.
LIRC can be configured to wake up the Mythtv display from DPMS screen blanking. This is done using a script via irexec. The same button can also be used to make the display go to sleep.
First edit the ~/.lircrc file to include the following stanza. A good Howto and MCE .lircrc file for Fedora Core 4 or 5 you can find here [1]:
begin prog = irexec button = Power repeat = 3 config = /usr/local/bin/mythpowerbutton.sh #config = Key Alt-Escape CurrentWindow end
Note that we need irexec running to make this all work. For me this was done via the myth-load.sh script, detailed in the main HOWTO Jarod Wilson has written [2].
Created a shell script in /usr/local/bin/, called mythpowerbutton.sh. Thanks to Yeechang Lee for this script [3]:
#!/bin/sh if [ `cat /tmp/mythsleeptogglestatus` == "off" ] then xset dpms force on; echo "on" > /tmp/mythsleeptogglestatus else sleep 1; xset dpms force off; echo "off" > /tmp/mythsleeptogglestatus fi
(This script might be able to be modified to not rely on a temp file, it could use xset to list DPMS status and toggle it?)
Make the script executable.
chmod a+x /usr/local/bin/mythpowerbutton.sh
Then
echo $PATH
and make sure /usr/local/bin is in the list. If not you will have to add it to /etc/??? (???- fix this!) and either log out and back in or start up irexec manually to see it function. If there are any other sections in the ~/.lircrc file that are associated with the POWER button, then they should be removed or you may see multiple things happen at once.
Now when the Power button on the remote is pressed, the screen should blank (DPMS on) and with one more press the Mythtv GUI should reappear (DPMS off).
This section originally appeared in MCE Remote.
--indulis 04:48, 3 October 2006 (UTC)