[mythtv-users] Autostart frontend ONLY on manual startup?

Fredrik Karlsson dargosch at gmail.com
Fri Mar 4 11:11:30 UTC 2005


I think I understand what you want. Here is what I did:

I created a startup script which sets lockfile only if the sciript is
supplied with the argument "auto":
mythtv at mythtv mythtv $ cat /usr/local/bin/mythguictrl

use warnings;
use strict;

package main;

my $lockfile = '/var/run/mythtv/mythguilockfile';

my $who = $ARGV[0];

system "rm $lockfile" if -e $lockfile;

if($who eq "auto"){

        system "echo 1 > $lockfile";

exit 1;


Next, I created .xinitrc and .xsession files looking like this:
mythtv at mythtv mythtv $ cat .xinitrc
# Merge X resources from ~/.Xdefaults
[ -f $HOME/.Xdefaults ] && xrdb $HOME/.Xdefaults

# Set the background and root cursor shape
xsetroot -solid \#400040
xsetroot -cursor_name top_left_arrow

# Start evilwm - snap to borders within 10 pixels
/usr/bin/evilwm -snap 6 -bw 0 &

/usr/X11R6/bin/xset s noblank &
/usr/X11R6/bin/xset s off &
/usr/X11R6/bin/xset -dpms &
#/usr/bin/xsetbg  /home/mythtv/.mythtv/silent-800x600.xpm
/usr/X11R6/bin/xsetroot -solid black

[  -f /var/run/mythtv/mythguilockfile ] || mythfrontend &

# sleep makes it so irxevent works
# uncomment these if you don't compile lirc into mythtv (set the lirc
USE variable to compile lirc support into mythtv)
sleep 3
irxevent &

# Transfer control to xclock - killing xclock (with Ctrl+Alt+Escape, say)
# will exit our session
exec xclock -digital -padding 2 -g -0+0

So, the frontend is ONLY started when the lockfile does not exist.
Finally, I set the startup command (in mythsetup) to
/usr/local/bin/mythguictrl $status
I dont have X access to the box right now, so I cannot ell you exactly
what the section in mythsetup is, but it is 'startupCommand' in the
'settings' table of the database...
The wakeup command I use is
/usr/local/sbin/nvram-wakeup -A -C /etc/nvram-wakeup.conf   -s
$(($time + 300 ))


More information about the mythtv-users mailing list