A clock and a fortune: a full screen clock with random quotes in Tcl/Tk I've written a small Tcl/Tk script for a friend that displays the current time, as well as a quote. He uses it in some project with a Raspberry Pi, and since I didn't want to cobble up something up in Qt, PyQt, or some kind of website, I tried to write something in Tcl/Tk.

Demo

Here is how it looks in the end:



Requirements

This script assumes that you have fortune available an in your $PATH.

Script

#!/usr/bin/env tclsh

proc every {ms body} {
    eval $body
    after $ms [info level 0]
}

label .time -bg black -fg white -font {Arial 150} -textvar ::time -pady 30
every 1000 { set ::time [clock format [clock sec] -format "%T"] }

label .fortune -bg black -fg white -font {Arial 15}  -textvar ::fortune
every 30000 { set ::fortune [exec fortune -s] }

pack .time -fill both
pack .fortune -fill both -expand 1

. configure -bg black

wm attributes . -fullscreen 1

bind . &lt;q&gt; exit


What to review

This is my first script in Tcl/Tk. Feel free to commend on anything, especially if there's some kind of common style I'm missing.
Nice code. I only see a couple of items


add package require Tk to be explicit you need tk
use uplevel #0 $body instead of eval