Author |
Message |
erroneous
|
Posted: Sun Feb 11, 2007 12:20 pm |
|
Joined: Sat Jan 28, 2006 7:44 am
Posts: 12
|
I use this on my mythtv box since I don't use my keyboard that often and let's face it, sometimes mythfrontend just fails leaving you with fluxbox and no mouse. Solution: make the power button do more than just an escape button, which stop already does anyway.
Add the following code to your .lircrc
Code: begin prog = irexec button = POWER config = sh ~/powerbutton.sh end Be sure not to change the lines already sending the Esc key to mythtv when power is pressed. This way if for some reason you need to restart mythfrontend and are watching something, it will try to escape first which hopefully saves your position. Either way though, it will kill off mythfrontend and then restart it. Then add the following to a file called ~/powerbutton.sh Code: if ps aux | grep mythfrontend then #Allow 5 seconds for Lirc to send Escape to MythFrontend sleep 5 killall mythfrontend mythfrontend & else mythfrontend & fi Alternatively, you could make powerbutton.sh turn on/off your monitor by changing ~/powerbutton.sh to Code: if xset q | grep -q "Monitor is On" then powerstate="off" else powerstate="on" fi xset dpms force $powerstate
|
|
Top |
|
|
bigbro
|
Posted: Sun Feb 11, 2007 1:34 pm |
|
Joined: Sat Dec 24, 2005 11:33 am
Posts: 400
Location:
Kitsap Peninsula, Wa., United States
|
Cool!
Just that alone is a major bump for the WAF!
She had just asked me about fixing that...
Used Code 1 and then built the ~/powerbutton.sh
Took me a sec to make sure i understood your reference to Quote: Be sure not to change the lines already sending the Esc key to mythtv when power is pressed.
So Inserted the script in that same section right after the Esc sequence End. So now lircrc looks like this.
Code: # Power Off/Exit begin prog = mythtv button = POWER config = Esc end begin prog = irexec button = POWER config = sh ~/powerbutton.sh end
Probably should insert a blank line between the two just for consistency but it works at this point.
Thanks!
_________________ KnoppMyth R5.5
MBE: AMD64 3400+, K8N Neo4 Plat., 1Gig, Asus Extreme N6200, 320G pata, 2x320Gsata, 750Gsata, PVR-150 Retail w/Blaster
SBE: AMD XP2000, GA 7ZMMH, 1 Gig, XFX 256M 6200, 20 Gig, PVR-150 Retail w/Blaster
SBE: AMD Dur1800, 512M, PVR500
|
|
Top |
|
|
erroneous
|
Posted: Sun Feb 11, 2007 2:45 pm |
|
Joined: Sat Jan 28, 2006 7:44 am
Posts: 12
|
Yeah you got it. That was exactly what I meant. Doesn't matter if you have the blank line there or not, it is just for you. I also put tabs into my file but again, personal preference. I used the second code for quite a while because I was using a really old monitor for a TV so I wanted to remotely turn it off.
Actually I kinda made it for the WAF. My fiance always gets annoyed when it crashes and since I had to SSH in and restart gdm to get it all going again, it was rather annoying. Maybe I can get her to start using mythtv without me, lol.
|
|
Top |
|
|
chrisj
|
Posted: Wed Feb 21, 2007 4:51 pm |
|
Joined: Tue Jan 17, 2006 7:34 am
Posts: 126
Location:
Australia
|
You could always go one step more to making it easer for your fiance,
I got a second remote from the local hi-fi shop with only a power, ok,menu, dimond , ch +/- and vol +/- and set it up for my 4 year old to use.
You just need to add it to you lircd.conf and lirc file, naming the remotes.
the power , stops the FE , changes the a theme to a custom version of "blue" , with the bits she dose not need removed , then restarts the FE
The menu returns to the first menu , the rest do as normal ..
(on my normal remote the power button reverts things back to the normal theme that I use )
Who need lots of buttons !
The odd part is that my wife has taken to using the simple remote
|
|
Top |
|
|
erroneous
|
Posted: Thu Feb 22, 2007 7:02 pm |
|
Joined: Sat Jan 28, 2006 7:44 am
Posts: 12
|
an interesting idea. Almost like an automatic user mode. Maybe I should look into setting up the IR receiver on my pcHDTV 5500 and doing something similar. Personally I use mythcenter-wide because it looks so nice. I had a modified menu set up from the DVR menu scheme that added Watch TV to the top of the first menu. I know that rearranging the menus can make the system much more user friendly, so maybe it is time I did that again.
|
|
Top |
|
|
Stef
|
Posted: Wed Mar 14, 2007 3:31 pm |
|
Joined: Wed Aug 02, 2006 9:29 am
Posts: 22
|
Thanks for that Erroneous, I've been meaning to implement something similar for a while and your post came in most useful.
I've set it up so that the power button turns the monitor off/on and have modified your script to add the following line at the start:
Code: xset dpms 0 0 0
as the original script causes DPMS to be enabled, resulting in the monitor automatically going into standby while watching TV after the default DPMS standby time (1200 s on my system). The above line disables the standby, suspend and off times.
I got this info from the following URL:
http://www.shallowsky.com/linux/x-screen-blanking.html
|
|
Top |
|
|
erroneous
|
Posted: Thu Mar 15, 2007 4:56 pm |
|
Joined: Sat Jan 28, 2006 7:44 am
Posts: 12
|
I rather like having dpms enabled in X. Most TVs say that they can have burn in issues, though I think some of them say that just to say that. Either way, change your dpms settings to have a higher timeout rate for turning the monitor off. I think I keep mine at 30 minutes. Also, mplayer has a setting somewhere to disable dpms while watching a video. Either way, running
Code: xset dpms 0 0 3600 should make it not turn off the monitor for 30 minutes. Also, setting the last value to 0 should make it so that it never turns off the monitor, and I believe that would not be reset unless your display manager or something sets it when you start X.
|
|
Top |
|
|
ryanau
|
Posted: Sat Mar 17, 2007 6:30 am |
|
Joined: Tue Feb 13, 2007 9:56 pm
Posts: 4
Location:
Western Australia
|
erroneous wrote: Then add the following to a file called ~/powerbutton.sh Code: if ps aux | grep mythfrontend then #Allow 5 seconds for Lirc to send Escape to MythFrontend sleep 5 killall mythfrontend mythfrontend & else mythfrontend & fi Small point of order, while the nature of the script doesn't matter either way - the if clause above will always return true as it will find the grep process itself also, the clause would be more correct as: Code: if pgrep mythfrontend
Now to discredit that, here's how stupid I discovered I was when I found the dpms blanking was not working ....
I set it up as above and it worked, then I rebooted and when the screen blanked, it would return consistently 1 second later. I checked everything, X keypress events, IR settings, added extra sleeps between all the commands etc.
Turns out my optical mouse was on top of the inverted power supply in my HTPC case, and it was detecting the spinning of the fan as minute mouse movement and returning from blanking, even though the mouse cursor wasn't visibly moving. What a way to waste a night
|
|
Top |
|
|
erroneous
|
Posted: Sat Mar 17, 2007 10:45 am |
|
Joined: Sat Jan 28, 2006 7:44 am
Posts: 12
|
Ah thanks. I hadn't heard of pgrep before. No wonder it was misbehaving for me, lol
|
|
Top |
|
|