import pathlib import tkinter as tk MARKER = pathlib.Path(r"__MARKER__") READY = pathlib.Path(str(MARKER) + ".ready") root = tk.Tk() root.title("Desktop") root.geometry("640x300+160+160") root.configure(bg="#eef0f4") def note(what): label.config(text="last action: " + what) MARKER.write_text(what) def bar(text, x): button = tk.Button(root, text=text, command=lambda: note(text)) button.place(x=x, y=12, width=110, height=38) return button label = tk.Label(root, text="last action: (none)", bg="#eef0f4") label.place(x=20, y=90) for _text, _x in [("Files", 20), ("Terminal", 150), ("Save", 280), ("Cancel", 410)]: bar(_text, _x) tk.Label(root, text="Choose an action", bg="#eef0f4").place(x=20, y=150) root.update() READY.write_text("mapped") root.mainloop()