diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2012-02-08 16:09:45 +0100 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2012-02-08 16:09:45 +0100 |
commit | 541c5bedec87ebeba298c598f4108a5dc47bfc58 (patch) | |
tree | 8b60182b687cf15454ce1b6606ce3fc18ecba201 /pylock.py | |
parent | fdce6479b90dbeef5ca1857b58e6a37ec21978fd (diff) | |
download | pylock-541c5bedec87ebeba298c598f4108a5dc47bfc58.tar pylock-541c5bedec87ebeba298c598f4108a5dc47bfc58.zip |
Added DBus interface
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): |