[mythtv-users] Re: VNC launches second mythfrontend

Allan Risk arisk at hamster.foxhollow.ca
Wed Apr 20 16:03:17 UTC 2005


>
> I am checking for the $DISPLAY variable in my start script like this:
>
> if [ $DISPLAY == ":0" ] ; then
>   nvidia-settings -l
>   mythfrontend
> fi
>
> If your $DISPLAY is ":0.0" for a local session, then you have to modify 
> the script.
>
> Thomas

I tried this and found that after KDE is up $DISPLAY is :0.0, but when the 
script is run it is :0.
Your script will then work, unmodified, the first time it is run.
I don't know if this ever happens, but if the script has to be run again (or 
maybe it could be used in the power button script?), the check would fail.

I tried to come up with something that covers that scenario and it seems to 
work.
I'm a complete novice to writing shell scripts, so if anyone has suggestions 
or improvements I'd love to hear them.

I'll look into the X options others suggested.  In the end they might be 
better options.
I'm not familar enough with the big picture to know my options.
Whether I end up using vnc or not, this irritated me and to paraphrase Jarod 
I was looking for a solution rather than workaround.

Anyways thanks for all the input.  Without it I wouldn't have a starting 
point.
Here is my script:
---


DISPLAYCHECK="`printenv DISPLAY | grep -c :0`"
# DISPLAYCHECK will be 1 if DISPLAY contains :0, :0.0, :0.1, etc.

if [ $DISPLAYCHECK = "1" ]
then
   # put stuff to run with mythfrontend here

# Load nVidia driver custom settings
nvidia-settings --load-config-only &
# Restore audio settings
/usr/sbin/alsactl restore
# Launch irexec for myth power button stop/start
irexec &
# Launch myth frontend
mythfrontend &

fi
exit




More information about the mythtv-users mailing list