aboutsummaryrefslogblamecommitdiffstats
path: root/examples/clock
blob: 163f7d537b3173473d558dca88798e43d59fe7d4 (plain) (tree)
1
2
3
4
5
6
7
8
9






                                                  

                               



                                           


                                                                                           


              
                                                                    

 
             


                                             
 
# -*- python -*-

# A simple xpybar configuration example of a clock

import time
import threading

from plugins.clock import Clock


OUTPUT, HEIGHT, YPOS, TOP = 0, 12, 24, True


clock = Clock(format = '%Y-(%m)%b-%d %T, %a w%V, %Z', utc = False, sync_to = Clock.SECONDS)


start_ = start
def start():
    start_()
    async(lambda : clock.continuous_sync(lambda : bar.invalidate()))


def redraw():
    text = clock.read()
    bar.clear()
    bar.draw_coloured_text(0, 10, 0, 2, text)