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

gibble gibble at gmail.com
Wed Nov 14 18:19:42 UTC 2007


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


gibble wrote:
> 
> There's already a backgrounds directory in the theme, just need it to
> randomly symlink background.png to one of them...
> 
> 
> Thomas Kessler-2 wrote:
>> 
>> On Nov 14, 2007 12:23 PM, gibble <gibble at gmail.com> wrote:
>> 
>>>
>>> Nice!  I'm using http://ftpmerou.free.fr/ubuntu/babaorum.png and it
>>> looks
>>> amazing (imho)
>>>
>> 
>> I might have to make a script that changes the background everyday, that
>> would be pretty cool...
>> 
>> TK
>> 
>> _______________________________________________
>> mythtv-users mailing list
>> mythtv-users at mythtv.org
>> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/glass-wide%2C-a-widescreen-GUI-theme-for-MythTV-released-tf4790200s15552.html#a13753169
Sent from the mythtv-users mailing list archive at Nabble.com.



More information about the mythtv-users mailing list