[mythtv-users] Sleep mythfrontend from remote

Philip Brady phil.brady at hotmail.co.uk
Wed Jan 21 11:31:42 UTC 2015



> Date: Wed, 21 Jan 2015 09:25:25 +1100
> From: michael at thewatsonfamily.id.au
> To: mythtv-users at mythtv.org
> Subject: Re: [mythtv-users] Sleep mythfrontend from remote
> 
> On 21/01/2015 3:42 AM, Josu Lazkano wrote:
> > Hello list,
> >
> > I have a frontend in the bedroom and I want to configure to shutdown
> > in a certain time (30/60/90 minutes). Maybe a bash script executed
> > with a remote key.
> >
> > Anyone got it?
> >
> > Regards.
> >
> I have a script that monitors xscreensaver, waits until the screen has 
> been blanked (screensaver active) for 5 minutes (15 minutes if frontend 
> is playing a recording/video - xscreensaver will only activate when 
> recording/video playback is paused).  When screensaver is active for 
> defined time, then it shuts down the system, if playback was paused, it 
> sets a bookmark before shutting down.
> 
> 
Have I got such a script?  Almost.


I run a combined FE/BE using
mythwelcome.  The power off button on the
remote triggers a script to force the FE back to welcome screen which then
closes down the system.

It needs xdotool installed
and the keybinding to allow escape key to quit the frontend.  Would adding an extra ‘sleep’ at the start do
it for you?

 

HTH

Phil

  

 

 

# /usr/bin/remotepower.sh

# Initiates a shutdown when
the remote power putton is pressed.

# Send escapes to Mythtv
frontend until it closes back to welcome

# Finally unlock shutdown in
case I forgot

 

#echo "$(date +%F"
"%T) $0 started">>/home/phil/my.log

REPLY=0

while [ $REPLY -eq 0 ]; do

     wmctrl -a 'MythTV Frontend'

     REPLY=$?

     if [ $REPLY -eq 0 ]; then

           xdotool key "Escape"

           #  echo "xdotool reply $?">>
/home/phil/my.log

           sleep 1

     fi

done

mythshutdown --unlock

exit

 

  		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-users/attachments/20150121/5ff9cc4f/attachment-0001.html>


More information about the mythtv-users mailing list