[mythtv-users] glass-wide, a widescreen GUI theme for MythTV released

Thomas Kessler electronikjunkie at gmail.com
Wed Nov 14 19:10:02 UTC 2007


On Nov 14, 2007 1:19 PM, gibble <gibble at gmail.com> wrote:

>
> This should work.
>
> #!/bin/bash
>
> # File locations
> BgPath=/usr/share/mythtv/themes/glass-wide/backgrounds
> BgFile=/usr/share/mythtv/themes/glass-wide/background.png
> TempLog=/tmp/random.log
>
> # Create a temporary logfile of all matches
> find $BgPath -iregex ".*.png" > $TempLog
>
> # Choose a random line number (any number from 1 to the length of the
> file)
> LowerBound=1
> RandomMax=32767
> UpperBound=$(cat $TempLog | wc -l)
> RandomLine=$(( $LowerBound + ($UpperBound * $RANDOM) / ($RandomMax + 1) ))
>
> # Use sed to grab the random line
> Command=$(sed -n "$RandomLine{p;q;}" "$TempLog")
>
> # Link the file
> ln -s $Command $BgFile
>
> # Restart X
> pkill xinit
>
>
Sweet. Now will mythfrontend have to be restarted after the background file
is linked?

TK
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mythtv.org/pipermail/mythtv-users/attachments/20071114/fcbb7037/attachment.htm 


More information about the mythtv-users mailing list