summaryrefslogtreecommitdiffstats
path: root/pylock.py
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2012-02-08 16:09:45 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2012-02-08 16:09:45 +0100
commit541c5bedec87ebeba298c598f4108a5dc47bfc58 (patch)
tree8b60182b687cf15454ce1b6606ce3fc18ecba201 /pylock.py
parentfdce6479b90dbeef5ca1857b58e6a37ec21978fd (diff)
downloadpylock-541c5bedec87ebeba298c598f4108a5dc47bfc58.tar
pylock-541c5bedec87ebeba298c598f4108a5dc47bfc58.zip
Added DBus interface
Diffstat (limited to 'pylock.py')
-rw-r--r--pylock.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/pylock.py b/pylock.py
index cad52fc..6903af5 100644
--- a/pylock.py
+++ b/pylock.py
@@ -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):