[mythtv-users] Full screen time display, with screen on

Dave M G martin at autotelic.com
Sat Mar 5 05:25:15 UTC 2011


Cool, thanks!

I was just messing around witn aosd_cat as suggested by Richard, and
despite my initial frustrations, I came up with this:

date +"%H:%M %m.%d.%Y" | tr " " "\n" | aosd_cat --font="Ubuntu 64"
--shadow-offset=1 --back-color=black --back-opacity=128 --position=4
--padding=255 --fore-color=white --lines=0 --fade-in=0 --fade-out=0
--lines=3 --age=1

Which does pretty well, except for two things:

1. The text seems to come out one line at a time, and I can't find a way
to put it all on the same screen at once.

2. The text seems to move around depending on the size and length of the
text being displayed.

I am going to try your script and see how that works. I'll let you know
if it works better (have to head to work right now though, so will
report later)

Thanks for your efforts!

Dave M G

(2011年03月05日 13:46), Brian Kirkman wrote:
> On 3/3/2011 8:02 PM, Dave M G wrote:
>> Dan, Brian,
>> Thanks for responding.
> You're welcome.  I always enjoy hacking a solution together, emphasis on 
> the hack.  Isn't Linux great!?
>> The ImageMagick option seems to be one possibility, though I've
>> experimented and found some troubles.
>> 1. I don't know if it can be made to time out. When I include a "diplay"
>> command in my script, it will stay up until manually closed.
> get the pid, sleep 5, and kill it (or killall if you prefer).  I know 
> you mentioned using a button press to kill the clock before if times 
> out.  This could be done with ps and if, then, else.
>> 2. I can't get it to be on top of the MythTV interface. It appears
>> underneath - in other words, not visible.
> try qiv instead of display.  It worked on my machine (Fedora 14, 
> Fluxbox, MythTV .24, nVidia).
>> 3. I have looked and have not found a full screen option. I can get it
>> to expand it's window to the maximum area of the screen, but not to be
>> actually full screen mode.
> qiv will fullscreen
>> Here is the command I ended up with after some experimentation
>> (black.png is, predictably, just a black image)
>> display -background '#000000' -bordercolor "#000000" -backdrop
>> /home/mythbuntu/black.png
>> I haven't got as far as trying to set up text over the image. I saw on
>> the 'net there were some ways to script in text, but I didn't understand
>> where that script was stored or executed.
>> I'm still not totally dicounting osd_cat, as it seems to have nice time
>> out options and is quick. If another, non-ImageMagick option comes up to
>> dim, darken, or paint black over top the screen becomes available, it
>> still might be the best way to go.
> I, too, like osd_cat and its simplicity, but the font setting is tough 
> to get configured, if at all even possible.  Also, it is an overlay, so 
> a solid background is not an option.
>> Oh, and by the way... the "sleep" command in the script I had before is
>> completely superfluous. I won't go into why I thought it was necessary
>> because it just isn't.
> Here's a script to display a solid background clock image on the screen 
> for five seconds.  You'll have to shoehorn it into your script where 
> necessary.  I didn't center the text either.
> - - -
> #!/bin/sh
> #Define background image file location
> BGFILE='/home/mythtv/screen_clock/black_bg.jpg'
> #Define clock image file location
> CLOCKFILE='/home/mythtv/screen_clock/black_clock.jpg'
> #Create the date string.
> #Use 'tr' to insert a line feed to place date and time on separate lines
> DATESTRING=`date +"%H:%M %m.%d.%Y" | tr " " "\n"`
> #Get display width
> WIDTH=`xdpyinfo | grep 'dimensions:' | awk '{print $2}' | cut -dx -f1`
> #Get display height
> HEIGHT=`xdpyinfo | grep 'dimensions:' | awk '{print $2}' | cut -dx -f2`
> #Define text height as a function of display height
> POINTSZ=$(echo $HEIGHT/6 | bc)
> #Remove the background image file because 'convert' will auto increment 
> and not overwrite
> rm -f $BGFILE
> #Create a blank canvas
> convert -size ${WIDTH}x${HEIGHT} xc:black $BGFILE
> #Write date/time over blank canvas
> convert -font helvetica -fill white -pointsize $POINTSZ -draw 'text 
> #Display date/time image
> qiv --fullscreen --scale_down -i $CLOCKFILE &
> #Get procid
> PID=$!
> #Keep image on display for 5 seconds
> sleep 5
> #Kill qiv to remove date/time image from display ('killall qiv' could 
> also be used)
> kill -9 $PID
> - - -
> Let us know how it goes.
> _______________________________________________
> mythtv-users mailing list
> mythtv-users at mythtv.org
> http://www.mythtv.org/mailman/listinfo/mythtv-users

More information about the mythtv-users mailing list