Skip to content

Commit

Permalink
Added Clocky.py
Browse files Browse the repository at this point in the history
  • Loading branch information
spignelon committed Mar 30, 2023
1 parent 082206a commit ab96d7b
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions Clocky.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import tkinter as tk
from tkinter import font
import time

def update_clock():
#current_time = time.strftime("%H:%M:%S")
current_time = time.strftime("%I:%M:%S %p")
clock.config(text=current_time)
clock.after(1000, update_clock)

root = tk.Tk()
root.overrideredirect(True)
root.geometry("110x40+0+0")
root.lift()
root.wm_attributes("-topmost", True)
root.config(bg='white')
root.attributes("-alpha", 0.8)

clock = tk.Label(root, font=("calibri", 15, "bold"), bg='white')
clock.pack(fill="both", expand=True)

# Add borders
clock.config(bd=2, relief="solid")

# Position the window at the top-right corner
root.geometry("+%d+%d" % (root.winfo_screenwidth()-110, 0))

update_clock()
root.mainloop()

0 comments on commit ab96d7b

Please sign in to comment.