I would like my children to only use the computer for 30 minutes, at which time I would like the screen to be locked. At that point, if I choose to unlock the screen again, I would like the screen to lock again in another 30 minutes.
How can I write a script to do this?
To lock the screen from the command line (on ubuntu), I can use the command
but how do I activate this command 30 minutes after unlock?
Thank you for the comment, which helps. Here is the solution I came up with, in python 2.x:
import gobject, dbus, time, subprocess
from dbus.mainloop.glib import DBusGMainLoop
def lock_status(bus, message):
if message.get_member() != "EventEmitted":
args = message.get_args_list()
if args == "desktop-unlock":
bus = dbus.SessionBus()