#!/usr/bin/python import sys import time import getopt import pyosd font = '-*-bitstream vera sans-bold-r-*-*-*-480-*-*-*-*-iso10646-1' color = '#40ffff' time_fmt = '%a %d %b, %H:%M' delay = 3 shadow = 2 pos = pyosd.POS_TOP align = pyosd.ALIGN_RIGHT offset = 2 opts, args = getopt.getopt(sys.argv[1:], 'f:c:d:', ['font=', 'color=', 'fmt=', 'delay=']) for opt, arg in opts: if opt in ('--font', '-f'): font = arg if opt in ('--color', '-c'): color = arg if opt in ('--delay', '-d'): font = arg try: time_fmt = args[0] except IndexError: pass if __name__ == '__main__': osd = pyosd.osd(timeout=delay, pos=pos, align=align, lines=1, offset=offset, font=font, colour=color, shadow=shadow) osd.display(time.strftime(time_fmt)) time.sleep(delay)