[mythtv-users] How to shutdown after X minutes?

xavier hervy xavier.hervy at bluebottle.com
Tue Jun 24 16:56:05 UTC 2008

On Tue, 2008-06-24 at 16:28 +0000, Matt Clifton wrote:
> What's the easiest way to tell Myth to shut down after a specified
> period of time has passed? It would be nice if I could change the
> sleep function within the Internal Player's menu to shut down the
> computer rather than just returning to the main menu if possible.
> Also, if the recording I'm watching has already ended, I still want it
> to turn off. For example, if I set the timer to 30 minutes and the
> recording I'm watching is only 22 minutes long, I still want it to
> turn off in 30 minutes.
> What I've tried so far is to add a custom menu option to the main
> menu, but I haven't been able to get it to work for whatever reason. I
> did something similar to adding this
> <button>
> <type>SHUTDOWN</type>
> <text>Sleep</text>
> <action>EXEC sudo shutdown -h +30</action>
> </button> 
> to the main menu. If I launch Myth by double clicking the front-end
> icon from Gnome, it doesn't work at all. I'm not sure why myth doesn't
> respond to the command in this case. If I start the frontend by typing
> in "mythfrontend" into the command line, then it works, but it
> "freezes" myth because myth waits for the process to end before
> regaining control. So I tried to fix that by doing:
> <button>
> <type>SHUTDOWN</type>
> <text>Sleep</text>
> <action>EXEC sudo shutdown -h now &</action>
> </button> 
> But that still causes problems, myth doesn't seem to like the
> ampersand.
Just write script gotosleep:
sudo shutdown -h +30 &
and in your button
<action>EXEC gotosleep</action>
> So the point is: whats the best way to do this? If possible it would
> be nice to just be able to change the command for the built in sleep
> function on the internal player, but I don't know if that's easy to
> change or if it will work if the recording I'm watching has ended.
> Otherwise, a new menu option is fine with me, but how can I get the
> above to work so that myth will still listen to the command when I
> launch the front end by double clicking the icon and so it won't
> "freeze"?
> Thanks,
> -Matt
> ______________________________________________________________________
> Earn cashback on your purchases with Live Search - the search that
> pays you back! Learn More
> _______________________________________________
> mythtv-users mailing list
> mythtv-users at mythtv.org
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users

More information about the mythtv-users mailing list