[mythtv-users] Mythbuntu 12.04 and sleep

Michael Watson michael at thewatsonfamily.id.au
Fri Sep 14 06:07:45 UTC 2012

On 14/09/2012 12:38 PM, Joseph Fry wrote:
>         > On Thu, Sep 13, 2012 at 1:52 PM, Joseph Fry <joe at thefrys.com
>         <mailto:joe at thefrys.com> <mailto:joe at thefrys.com
>         <mailto:joe at thefrys.com>>> wrote:
>             >>
>             >> How are your 10.04 and 11.10 machines configured to
>         sleep.  I
>             know that
>             >> mythtv will pause the idle timer on Xscreensaver, but
>             xscreensaver can't
>             >> make my machine actually go to sleep, just the display.
>             >
>             >
>             > Oops.  I assumed you meant blanking the display!  Sorry
>         for the
>             confusion.
>             You have checked out the wiki article right?
>         http://www.mythtv.org/wiki/Putting_mythfrontend_to_sleep
>         Many times.  However it doesn't cover sleeping automatically
>         when the system is idle.  My family is notorious for pausing a
>         show and walking away for hours.  I want the system to wait 5
>         minutes, display my screensaver for 15 minutes, then go to
>         sleep.  I can get the screensaver working no problem.  I can
>         manually suspend, both from a menu option and from a button on
>         my remote. And I can wake from remote.  But I cannot get the
>         system to suspend when left idle.
>         I can get the system to suspend automatically, but it does it
>         even when I am watching something because mythtv does not
>         deactivate the xfce4-power-manager when watching something.
>         The only thing I can think of is creating some sort of cron
>         script that checks the xscreensaver status every few minutes
>         and when it has been active for a certain amount of time it
>         kicks off a dbus command to suspend the system.
>         I found a pretty good script here I may be able to adapt:
>         http://www.mentby.com/Group/mythtv-users/how-to-make-idle-frontend-exit.html
>         but it seems like suspending on idle should be far simpler to
>         implement than this.  Surely I'm not the only person doing this.
>     I had the same problem, that is why I wrote the python script you
>     mention in the link.  My system is a bit more complicated, as my
>     frontend's are also slave backends to assist in commercial
>     flagging, metadata lookups whilst they are on.  The python script
>     can be simplified if you are only running a frontend, but it will
>     need to be run via cron periodically to check the xscreensaver
>     status.  Let me know, and I am happy to strip it down for you for
>     frontend use, but will run via crontab for frontend only as it is.
>     I did at one point create a "screensaver" stub that performed
>     executed a real screen saver, waited for a defined period and
>     shutdown the frontend, but I found this a bit of a kludge, and
>     more difficult to setup.
>     MythWelcome can shutdown frontend, but you have to exit the
>     frontend for it to work, as of 0.25 (I think), there is suppose to
>     be frontend idle detection, but in my experience it did not work
>     effectivly, shutting down the frontend immediatly after watching a
>     recorded program or video, during music playback, and sometimes
>     just allowing the system to stay running when it has not been used
>     in hours, it also does not shutdown the frontend cleanly (when it
>     does shutdown the machine), so any Music Playlists you have
>     created/edited in that session are lost.
> Thanks for your script... I used it as a reference when I used mine. 
>  My script is much simpler, and takes advantage of the fact that 
> mythfrontend will disable xscreensaver during playback.  It's not 
> suitable for a combined BE/FE, but it meets my needs really well.  I 
> just have it start at boot in my session manager.  The script is here: 
> http://www.mythtv.org/wiki/Sleep(Suspend)_When_Idle 
> <http://www.mythtv.org/wiki/Sleep%28Suspend%29_When_Idle>
Thats nice and simple, but;
         If you do not have a visualizer running, mythmusic allows 
screensaver and DPMS to activate whilst playing music
         MythBrowser will allow the screensaver to activate whilst 
viewing web pages, and thus cause your script to shutdown machine
         My script checks if a recording/video is paused, and sets a 
bookmark before shutting down.  (Or clears the bookmark if one is set, I 
havent as yet worked out how to check if there are any bookmarks set)

More information about the mythtv-users mailing list