I want to run a script in Python to detect when a user tries to unlock the screen, but fails.

I use elementary OS Freya and light-lock. I tried it with dbus, but I couldn't figure out how to do it.

I'm trying this:

dbus-monitor "type='signal',interface='org.freedesktop.login1.Session'"

This is the result:

signal sender=org.freedesktop.DBus -> dest=:1.170 serial=2 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameAcquired
string ":1.170"

I don't know what to make of this. Because after that, the terminal stays quiet and doesn't show anything.

  • Do you mean when someone logs in, or when someone unlocks the screen? Do you want to run this when a user is typing their username/password, or only if the login/password is accepted? – Gilles Jul 14 '15 at 22:34
  • I mean when a password don't match. – Kalt Wulx Jul 14 '15 at 22:44
  • Oh, that was really not clear in your original post. On the login screen, or on a screen unlock? And why are you listening to dbus events? Are you trying to do this without having root access? That's not going to work. – Gilles Jul 14 '15 at 23:02
  • Ups!, Sorry about that D:, Is in the login screen, Why? Well... I'm trying to create a logging error detector for use in an application. And yes, I'am trying to do this only a simple user. In this question superuser.com/questions/662974/logging-lock-screen-events apparently can do it – Kalt Wulx Jul 14 '15 at 23:13
  • 1
    You probably need to approach the other way, the lock ask libpam, and libpam logs everything. – Braiam Jul 15 '15 at 0:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.