diff options
Diffstat (limited to 'pylock.py')
-rw-r--r-- | pylock.py | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -6,8 +6,9 @@ import os import pwd import locale -from gi.repository import Gtk, Gdk +from gi.repository import Gtk, Gdk, Gio +from DBus import DBus from Locker import Locker from LockWindow import LockWindow import pam @@ -18,7 +19,7 @@ def get_username(): theme = 'UzL-login' -timeout = 5 +timeout = 500 logoutTimeout = 15 username = get_username() @@ -39,8 +40,11 @@ locale.textdomain('pylock') Gtk.Settings.get_default().set_property('gtk-theme-name', theme) + + window = LockWindow() + def lock(timeLeft): window.updateLockMessage(username, timeLeft) window.lock() @@ -51,9 +55,13 @@ def logout(): def updateTimeout(timeLeft): window.updateLockMessage(username, timeLeft) + locker = Locker(timeout, lock, window.unlock, logoutTimeout, logout, updateTimeout) -pamAuth = pam.pam() +dbus = DBus(locker) + + +pamAuth = pam.pam() def tryUnlock(w, password): if pamAuth.authenticate(username, password): |