I've recently been playing around with a 4B and an official touch screen, trying to make an alarm clock. I'm using python3 and tkinter to draw a full screen clock and its working well.
The only issue that I am having is that when the script is running in full screen, the screen lock activates after 10mins and presents a login prompt. Upon entering the password, the script has been terminated. Obviously this is no use as a clock.
I have both unclutter and xscreensaver installed - both of which work perfectly when displaying the desktop. It is only when I run the clock script that the screen lock activates.
Can anyone advise on what I can do to disable the screen lock?
Below is the code relating to tkinter. I have excluded the fuction 'show_time', which contains the clock specific code.
Code: Select all
#tkinter root root = Tk() root.attributes("-fullscreen", True) root.configure(background='black') root.bind("<Escape>", quit) root.bind("x", quit) root.after(1000, show_time) txt.set(current_datetime.strftime("%H:%M")) lbl = ttk.Label(root, textvariable=txt, font=fnt, foreground=font_colour, background="black") lbl.place(relx=0.5, rely=0.5, anchor=CENTER) fnt = font.Font(family='PibotoLT', size=225, weight='bold') txt = StringVar() root.mainloop()