You are not logged in.

#1 2011-07-18 16:27:06

Guff
Member
Registered: 2009-09-30
Posts: 158
Website

lualock: a silly screenlocker that's highly configurable in lua

Alright, so, I haven't been very satisfied with the state of screenlockers on *nix. Sure, GNOME and KDE have their own things that work fairly well and look nice, but I don't want to pull in all those dependencies for one measly screenlocker. I just want something that looks nice. So, I did some work on slimlock, and was fairly satisfied. Until I realized, hey, this doesn't have a bunch of pointless bells and whistles! How am I supposed to do anything ridiculous and totally unnecessary with this?

Thus, lualock (available in the AUR as lualock-git) was born. Prematurely, I might add. There's still some kinks to work out, and the API could use some sprucing up.

Why?

Why not?

WARNING:

I cannot guarantee that lualock is stable. Since this is a screenlocker, being stable is kind of a big deal. But currently, I would consider lualock to be somewhere between alpha and beta stage. Definitely in the testing phase. So, let me know if you have any issues whatsoever, but please don't use it in an environment where security or your privacy is crucial, because I can't guarantee it won't crash.

I'm posting this now just so that I can get an idea of what still needs to be done. It's hard for me to test every use case, so there's certainly some issues that I have missed thus far.

Features:
  • Configured using lua, so it can do pretty much anything you want it to. Right now, the sample configuration sets your DPMS settings, and restores them to their normal values once the screen gets unlocked. lualock provides hooks so that arbitrary lua code can be run on certain events (currently "lock", "unlock", and "auth-failed"), so there's lots of stuff one could do. Maybe set your IM status to "away" on lock, and to "available" on unlock.

  • Lets you set the window background (caveat: currently, if you want the background to actually be in the background, set it before adding any other images or text or anything).

  • Can display arbitrary images and text. New blank images can be created, as well. Images can also be drawn on. Currently, lines, rectangles, and circles are available.

  • Has timer functionality, so you can set it up to execute a given lua function periodically. This is used in the example configuration to draw a fancy little clock that is updated every second.

  • 100% compatible with Imagination™.

Dependencies
  • gtk3

  • lua

  • lua-oocairo-git

  • lua-oopango-git

  • libxss

  • pam

Using it:
  • Well, first off, if you want to customize the config (you almost certainly will have to for it to look right, as it's somewhat dependent on your screen's DPI, which may be different from mine) you should copy it from /etc/xdg/lualock/rc.lua to ~/.config/lualock/rc.lua

  • By default, runs as a daemon. After the timeout specified in rc.lua, the screen will be locked. However, I don't care much for that, so I always run it it as:

    lualock -n

    which locks the screen once and exits.

  • All configuration is done in rc.lua

Lacking features and bugs:
  • Multi-monitor support is currently lacking. I haven't tested it yet, though I'm fairly certain it won't work as intended on multi-monitor setups. I intend to work on this.

  • lualock is currently poorly documented. I'm working on it, though. You can find the current API docs here.

Links:
Screenshot of sample config:

tOWoybQ
The glowy red dots indicate the number of failed login attempts. Also, I'm not a design person. This is simply a sample of what can be done. Someone more artsy could do much better.

Addendum

Again, I don't yet consider lualock to be sufficiently stable to be used in a situation where security and/or privacy is paramount. Use at your own risk.
Let me know if there are any issues, though. Feature requests would also be appreciated.

And if you need any help, don't hesitate to ask.

Last edited by Guff (2011-07-29 20:12:33)

Offline

#2 2011-07-18 16:39:38

examon
Member
Registered: 2011-05-07
Posts: 208

Re: lualock: a silly screenlocker that's highly configurable in lua

Tested it, looks good.
Where can I find default rc.lua?

Offline

#3 2011-07-18 17:01:59

Guff
Member
Registered: 2009-09-30
Posts: 158
Website

Re: lualock: a silly screenlocker that's highly configurable in lua

examon wrote:

Tested it, looks good.
Where can I find default rc.lua?

It should be in /etc/xdg/lualock/rc.lua

Offline

#4 2011-07-18 21:02:26

avx
Member
Registered: 2011-07-05
Posts: 71

Re: lualock: a silly screenlocker that's highly configurable in lua

Interesting, will play with this.

Now, for the perfect world, add DM-functionality to it - at least I'd be happy to have a unified look for session selection and screen locking.

Oh, btw, what would it take to intercept keyboard/mouse-input, ie to create shortcuts or buttons(hibernate, etc.)?

Offline

#5 2011-07-18 21:23:30

Guff
Member
Registered: 2009-09-30
Posts: 158
Website

Re: lualock: a silly screenlocker that's highly configurable in lua

Also, I've mostly finished the API docs. luadoc has several limitations that make it hard to accurately document several things, but the usage examples given should all be accurate.

avx wrote:

Interesting, will play with this.

Now, for the perfect world, add DM-functionality to it - at least I'd be happy to have a unified look for session selection and screen locking.

Oh, btw, what would it take to intercept keyboard/mouse-input, ie to create shortcuts or buttons(hibernate, etc.)?

Exactly what DM functionality would you like to see?

I've thought about adding support for intercepting keypress events, but that makes me a little nervous. What with being able to record the user's password and all. I'm not sure. I'd love some more input on the issue.

Offline

#6 2011-07-18 21:37:16

avx
Member
Registered: 2011-07-05
Posts: 71

Re: lualock: a silly screenlocker that's highly configurable in lua

I don't need much, functionality like SLiM's ok, so select a session/set a default, and identfiy. Configuarability is key, where my goal would be to transition as smoothly as possible between the instances, ie pull colors/themes from my awesome-config and use it with DM and locker, place the infos I've got in the awesome topbar into them, etc.

I've thought about adding support for intercepting keypress events, but that makes me a little nervous. What with being able to record the user's password and all.

Care to elaborate on what you are fearing, I don't see much of a threat here.

Offline

#7 2011-07-18 21:46:26

Guff
Member
Registered: 2009-09-30
Posts: 158
Website

Re: lualock: a silly screenlocker that's highly configurable in lua

avx wrote:

I don't need much, functionality like SLiM's ok, so select a session/set a default, and identfiy. Configuarability is key, where my goal would be to transition as smoothly as possible between the instances, ie pull colors/themes from my awesome-config and use it with DM and locker, place the infos I've got in the awesome topbar into them, etc.

Care to elaborate on what you are fearing, I don't see much of a threat here.

I'm not sure exactly what you mean. Are you saying you'd want it to act as an actual DM and handle logins? Or do you just mean the session selected in lualock would determine the theming and whatnot?

I dunno, my fears might be totally unfounded. After all, if an attacker can modify someone's config to record the user's password, the attacker has already compromised the system, I guess. I figure I'll think about it a bit more, and if I can't come up with any reason not to, I'll go ahead and add the functionality.

Offline

#8 2011-07-18 22:21:40

avx
Member
Registered: 2011-07-05
Posts: 71

Re: lualock: a silly screenlocker that's highly configurable in lua

Are you saying you'd want it to act as an actual DM and handle logins?

Ehm, well, more or less, yes.

It doesn't have to be this app and it's not needed to have both functionalities in one app. In principle, I like SLiM and slimlock, since the latter tries to mimick the style of the former - which is what I want. But they are just too limited in what one can do with it.

The GNOME/KDE-solutions are way to heavy on deps and XDM can do a lot, but there's no corresponding locker. I once had high hopes for enlightenments 'entrance', but since that is dead/gets replaced, there isn't anything I know of to fill this space. So currently I see either flexible, but non-unified or unified and too simple.

Offline

#9 2011-07-19 00:10:46

Guff
Member
Registered: 2009-09-30
Posts: 158
Website

Re: lualock: a silly screenlocker that's highly configurable in lua

Alright, added keybinding functionality. There's now a keybinder() function, which is covered in the docs. Let me know if there are any issues.

avx wrote:

Ehm, well, more or less, yes.

It doesn't have to be this app and it's not needed to have both functionalities in one app. In principle, I like SLiM and slimlock, since the latter tries to mimick the style of the former - which is what I want. But they are just too limited in what one can do with it.

The GNOME/KDE-solutions are way to heavy on deps and XDM can do a lot, but there's no corresponding locker. I once had high hopes for enlightenments 'entrance', but since that is dead/gets replaced, there isn't anything I know of to fill this space. So currently I see either flexible, but non-unified or unified and too simple.

Ah. Well, I certainly feel the same way. LightDM seems pretty promising as far as DMs go, but that wouldn't solve the screenlocker issue.

I would love to be able to make lualock a full-fledged DM, but unfortunately I think that's beyond my abilities at the moment. It's not something I have a decent understanding of.

Offline

#10 2011-07-19 01:18:55

avx
Member
Registered: 2011-07-05
Posts: 71

Re: lualock: a silly screenlocker that's highly configurable in lua

Seems you've forgotten to push keybinder.h, it's referenced in the code, but nowhere in the repository.

I would love to be able to make lualock a full-fledged DM, but unfortunately I think that's beyond my abilities at the moment. It's not something I have a decent understanding of

Sadly, dito.

Offline

#11 2011-07-19 01:34:58

Guff
Member
Registered: 2009-09-30
Posts: 158
Website

Re: lualock: a silly screenlocker that's highly configurable in lua

avx wrote:

Seems you've forgotten to push keybinder.h, it's referenced in the code, but nowhere in the repository.

Oh, crud. Okay, just pushed it. Hopefully I didn't forget anything this time.

Let me know if it works for you.

Offline

#12 2011-07-19 01:44:49

avx
Member
Registered: 2011-07-05
Posts: 71

Re: lualock: a silly screenlocker that's highly configurable in lua

Now builds fine for me and runs ok - only tested the default config for now, thanks.

As for multi-screen, all my monitors are "blackened" and the elements are placed on the primary monitor - using nVidia TwinView here.

For those interested, I created an ebuild for Gentoo, I use it as x11-misc/lualock-9999

# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=4
inherit git

EGIT_REPO_URI="git://github.com/Guff/lualock.git"
KEYWORDS="~amd64 ~x86"

DESCRIPTION="screenlocker configurable via Lua"
HOMEPAGE="https://github.com/Guff/lualock"

LICENSE="GPL-2"
SLOT="0"

DEPEND="
    dev-lang/lua
    media-libs/clutter-gtk
    virtual/pam
    x11-libs/libXScrnSaver
"

RDEPEND=""

src_prepare() {
        git_src_prepare
}

src_compile() {
    emake  || die "emake failed"
}

src_install() {
    emake DESTDIR="${D}" install || die "Installation failed"
}

As for your listed dependencies, are you sure that's really all? `ldd` gives me a lot

linux-vdso.so.1 =>  (0x00007fffdb395000)
    libclutter-gtk-1.0.so.0 => /usr/lib64/libclutter-gtk-1.0.so.0 (0x00007f6f409f5000)
    libclutter-glx-1.0.so.0 => /usr/lib64/libclutter-glx-1.0.so.0 (0x00007f6f4068d000)
    libgtk-3.so.0 => /usr/lib64/libgtk-3.so.0 (0x00007f6f4007e000)
    libjson-glib-1.0.so.0 => /usr/lib64/libjson-glib-1.0.so.0 (0x00007f6f3fe5f000)
    libGL.so.1 => //usr/lib64/opengl/nvidia/lib/libGL.so.1 (0x00007f6f3fb4f000)
    libdrm.so.2 => /usr/lib64/libdrm.so.2 (0x00007f6f3f944000)
    libX11.so.6 => /usr/lib64/libX11.so.6 (0x00007f6f3f604000)
    libXext.so.6 => /usr/lib64/libXext.so.6 (0x00007f6f3f3f1000)
    libXdamage.so.1 => /usr/lib64/libXdamage.so.1 (0x00007f6f3f1ee000)
    libXcomposite.so.1 => /usr/lib64/libXcomposite.so.1 (0x00007f6f3efeb000)
    libXi.so.6 => /usr/lib64/libXi.so.6 (0x00007f6f3eddb000)
    libXfixes.so.3 => /usr/lib64/libXfixes.so.3 (0x00007f6f3ebd4000)
    libgdk-3.so.0 => /usr/lib64/libgdk-3.so.0 (0x00007f6f3e959000)
    libatk-1.0.so.0 => /usr/lib64/libatk-1.0.so.0 (0x00007f6f3e738000)
    libgio-2.0.so.0 => /usr/lib64/libgio-2.0.so.0 (0x00007f6f3e411000)
    libpangoft2-1.0.so.0 => /usr/lib64/libpangoft2-1.0.so.0 (0x00007f6f3e1e4000)
    libpangocairo-1.0.so.0 => /usr/lib64/libpangocairo-1.0.so.0 (0x00007f6f3dfd7000)
    libgdk_pixbuf-2.0.so.0 => /usr/lib64/libgdk_pixbuf-2.0.so.0 (0x00007f6f3ddb8000)
    libcairo-gobject.so.2 => /usr/lib64/libcairo-gobject.so.2 (0x00007f6f3dbaf000)
    libcairo.so.2 => /usr/lib64/libcairo.so.2 (0x00007f6f3d893000)
    libpng14.so.14 => /usr/lib64/libpng14.so.14 (0x00007f6f3d669000)
    libpango-1.0.so.0 => /usr/lib64/libpango-1.0.so.0 (0x00007f6f3d41e000)
    libfreetype.so.6 => /usr/lib64/libfreetype.so.6 (0x00007f6f3d181000)
    libfontconfig.so.1 => /usr/lib64/libfontconfig.so.1 (0x00007f6f3cf4c000)
    libgobject-2.0.so.0 => /usr/lib64/libgobject-2.0.so.0 (0x00007f6f3ccfc000)
    libgmodule-2.0.so.0 => /usr/lib64/libgmodule-2.0.so.0 (0x00007f6f3caf8000)
    libgthread-2.0.so.0 => /usr/lib64/libgthread-2.0.so.0 (0x00007f6f3c8f3000)
    librt.so.1 => /lib64/librt.so.1 (0x00007f6f3c6ea000)
    libglib-2.0.so.0 => /usr/lib64/libglib-2.0.so.0 (0x00007f6f3c3d2000)
    liblua.so.5 => /usr/lib64/liblua.so.5 (0x00007f6f3c1a5000)
    libm.so.6 => /lib64/libm.so.6 (0x00007f6f3bf21000)
    libXss.so.1 => /usr/lib64/libXss.so.1 (0x00007f6f3bd1d000)
    libpam.so.0 => /lib64/libpam.so.0 (0x00007f6f3bb10000)
    libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f6f3b8f2000)
    libc.so.6 => /lib64/libc.so.6 (0x00007f6f3b54b000)
    libresolv.so.2 => /lib64/libresolv.so.2 (0x00007f6f3b330000)
    libz.so.1 => /lib64/libz.so.1 (0x00007f6f3b119000)
    libxcb.so.1 => /usr/lib64/libxcb.so.1 (0x00007f6f3aefc000)
    libXau.so.6 => /usr/lib64/libXau.so.6 (0x00007f6f3acf9000)
    libXdmcp.so.6 => /usr/lib64/libXdmcp.so.6 (0x00007f6f3aaf3000)
    libdl.so.2 => /lib64/libdl.so.2 (0x00007f6f3a8ef000)
    libXinerama.so.1 => /usr/lib64/libXinerama.so.1 (0x00007f6f3a6ec000)
    libXrandr.so.2 => /usr/lib64/libXrandr.so.2 (0x00007f6f3a4e3000)
    libXcursor.so.1 => /usr/lib64/libXcursor.so.1 (0x00007f6f3a2d8000)
    libexpat.so.1 => /usr/lib64/libexpat.so.1 (0x00007f6f3a0ae000)
    libnvidia-tls.so.275.09.07 => //usr/lib64/opengl/nvidia/lib/libnvidia-tls.so.275.09.07 (0x00007f6f39eac000)
    libnvidia-glcore.so.275.09.07 => /usr/lib64/libnvidia-glcore.so.275.09.07 (0x00007f6f38086000)
    libpixman-1.so.0 => /usr/lib64/libpixman-1.so.0 (0x00007f6f37e10000)
    libxcb-shm.so.0 => /usr/lib64/libxcb-shm.so.0 (0x00007f6f37c0d000)
    libxcb-render.so.0 => /usr/lib64/libxcb-render.so.0 (0x00007f6f37a04000)
    libXrender.so.1 => /usr/lib64/libXrender.so.1 (0x00007f6f377fa000)
    libbz2.so.1 => /lib64/libbz2.so.1 (0x00007f6f375ea000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f6f40c00000)

Last edited by avx (2011-07-19 15:36:46)

Offline

#13 2011-07-19 02:09:42

Guff
Member
Registered: 2009-09-30
Posts: 158
Website

Re: lualock: a silly screenlocker that's highly configurable in lua

Ah, okay

As for the dependencies, I realize I forgot pam. But yeah, almost all of those are pulled in by clutter-gtk as far as I know.

Offline

#14 2011-07-19 02:29:19

avx
Member
Registered: 2011-07-05
Posts: 71

Re: lualock: a silly screenlocker that's highly configurable in lua

May be the case on Arch, I'll check on a base Gentoo tomorrow, for now it's bed time.

Offline

#15 2011-07-19 13:42:21

Guff
Member
Registered: 2009-09-30
Posts: 158
Website

Re: lualock: a silly screenlocker that's highly configurable in lua

avx wrote:

May be the case on Arch, I'll check on a base Gentoo tomorrow, for now it's bed time.

Well, let me now what you find out.

In the meantime, I'm not really satisfied with the keybinding implementation, but I'm having trouble thinking of a better way to do it. See, I want to keep the core lualock code as separate from the lua binding code as I can, but the current keybinder implementation has a bunch of lua-related code in lualock's keypress handler. I dunno.

Anyways, can you think of any other non-DM related features you might like to see?

Offline

#16 2011-07-19 15:41:56

avx
Member
Registered: 2011-07-05
Posts: 71

Re: lualock: a silly screenlocker that's highly configurable in lua

Added pam to the ebuild, going to place it on the bugtracker or sunrise later tonight.

As for more features, I can't tell yet, got to play with it and see what's possible, but, some things I'd like to be able to achieve:

- suspend/hibernate after time X
- display some things, ie battery left, X missed messages on irc/xmpp/..., currently playing song with album cover, ...

Offline

#17 2011-07-19 16:03:10

Guff
Member
Registered: 2009-09-30
Posts: 158
Website

Re: lualock: a silly screenlocker that's highly configurable in lua

avx wrote:

Added pam to the ebuild, going to place it on the bugtracker or sunrise later tonight.

As for more features, I can't tell yet, got to play with it and see what's possible, but, some things I'd like to be able to achieve:

- suspend/hibernate after time X
- display some things, ie battery left, X missed messages on irc/xmpp/..., currently playing song with album cover, ...

All of those can currently be done. Just a matter of writing the lua code, I think.

For the first one, you could do:

suspend_timer = timer(function () os.execute("sudo pm-suspend") end, X)
suspend_timer:start()

where X is the number of seconds. I think "sudo pm-suspend" could be replaced with something like:

dbus-send --system --print-reply --dest="org.freedesktop.UPower" /org/freedesktop/UPower org.freedesktop.UPower.Suspend

in order to use it without sudo.
Make sure lualock is up-to-date, as I just changed the timer stuff and the sample config a little while ago.

As for the other stuff, that's a bit more complicated. Well, I might need to add something to the image API, too. Not sure. I'll try making a battery indicator in a bit, just need to take care of some things.

Offline

#18 2011-07-19 16:25:33

avx
Member
Registered: 2011-07-05
Posts: 71

Re: lualock: a silly screenlocker that's highly configurable in lua

BTW, is there a specific reason you chose clutter-gtk? I mean, it works, but it's imho not quite common, more so in what I'd call target audience.

Offline

#19 2011-07-19 16:37:16

Guff
Member
Registered: 2009-09-30
Posts: 158
Website

Re: lualock: a silly screenlocker that's highly configurable in lua

avx wrote:

BTW, is there a specific reason you chose clutter-gtk? I mean, it works, but it's imho not quite common, more so in what I'd call target audience.

Because it was easy. tongue

Previously, it was just using GDK + cairo. It worked, but the drawing process was awfully complicated. Double buffering on several different levels. Plus, every time a single object was updated, the whole screen had to be redrawn. Without any hardware acceleration, either. This resulted in a CPU usage of 10-20% just for a simple text clock and a rotating image, which I did not consider acceptable for a screenlocker. Eventually I realized clutter was well-suited to what I was doing, and it didn't require too much of a rewrite. And it eliminated a lot of code.

Is there anything you have in mind? I'm open to using a different back-end for drawing. As you said, clutter-gtk isn't used very commonly.

Offline

#20 2011-07-19 17:12:19

avx
Member
Registered: 2011-07-05
Posts: 71

Re: lualock: a silly screenlocker that's highly configurable in lua

Because it was easy

That's what I guessed big_smile

Better ideas, mh, not really. But maybe your implementation just sucked? I mean, conky uses Cairo (and imlib2) AFAIK and it never used that much CPU - usually less than 3%.

AFAIK, lightdm has a webkit(-gtk)-backend and considering that users of uzbl/luakit/jumanji/chromium/... - which imho seem to be the target audience - already have it on their system, maybe that would be a way to go?

Last edited by avx (2011-07-19 17:12:53)

Offline

#21 2011-07-19 18:11:16

Guff
Member
Registered: 2009-09-30
Posts: 158
Website

Re: lualock: a silly screenlocker that's highly configurable in lua

avx wrote:

Better ideas, mh, not really. But maybe your implementation just sucked? I mean, conky uses Cairo (and imlib2) AFAIK and it never used that much CPU - usually less than 3%.

AFAIK, lightdm has a webkit(-gtk)-backend and considering that users of uzbl/luakit/jumanji/chromium/... - which imho seem to be the target audience - already have it on their system, maybe that would be a way to go?

Well, it was drawing 10-15 frames per second. The sample config back then included a spinning image that spun fairly quickly. Of course, my implementation likely sucked, as well. There's at least one thing I could have done to minimize unneeded drawing but it wouldn't have been easy I don't think. Thing is, even if I could get the CPU usage down, clutter is just so much easier.

Well, that's interesting. I'll certainly look into it, but that's certainly not my area of expertise.

Offline

#22 2011-07-20 15:15:47

Guff
Member
Registered: 2009-09-30
Posts: 158
Website

Re: lualock: a silly screenlocker that's highly configurable in lua

avx, I've come up with an incredibly primitive battery indicator. Not going to include it in the sample config, as not everyone actually has a battery, but here it is:

batt_box = image(100, 200)
batt_box:set_position(0.8, 0.1)
batt_box:show()

batt_timer = timer(function ()
    local batt_info = odious.util.get_battery("BAT0")
    local level = batt_info.charge_now / batt_info.charge_full
    local fill_height = batt_box:height() * level
    batt_box:clear()
    batt_box:draw_rectangle(0, 0, 100, 200, false, "#cccccc")
    batt_box:draw_rectangle(1, batt_box:height() - fill_height,
                            batt_box:width() - 1, fill_height, true, "#00ff00")
    batt_box:show()
end, 1)
batt_timer:start()

You can just add that to the end of your config, and it should work. Well, make sure lualock is up to date, though. This depends on some stuff I added (i.e. took from vicious) to lualock's odious library. You might have to change the "BAT0" part to the name of your battery.

As I said, it's incredibly primitive, and there's much room for improvement. But it's an example of what can be done. For example, you could have the color of the fill be dependent on the battery's level. You could also make it look a bit more like an actual battery, either by drawing a tiny horizontal rectangle on the top of the box, or by using an image of a battery and drawing the fill color on that.

If anyone besides me and avx is actually using this, and you've got any ideas, suggestions, etc. I'd love to hear them.

Last edited by Guff (2011-07-20 15:16:52)

Offline

#23 2011-07-20 19:50:25

avx
Member
Registered: 2011-07-05
Posts: 71

Re: lualock: a silly screenlocker that's highly configurable in lua

Nice one, thanks. I'll try that one the weekend, for now I've got to move some Macs to Lion.

Offline

#24 2011-07-21 18:08:42

avx
Member
Registered: 2011-07-05
Posts: 71

Re: lualock: a silly screenlocker that's highly configurable in lua

Couldn't try, yet, but here are some more ideas.

a) create a stacking waiting time after failed auth tries, ie something like (pseudo-code)

attempts, timeout, interval = 0, 0, 3
while not authenticated
  timer.start(timeout)
  *authentication here*
  if not authentication
    attempts += 1
    timeout = ( atempts ** 2 ) / 2 ) * interval
  end
end

b) alternatively, shut down the system after X failed attempts, though this could be used by bad people for an "offline DOS attack".

c) hook the process, when the first key is pressed. I'd use this to record a video/picture, if authentication fails, save it to disk with timestamp, if it succeeds, delete the video.

Offline

#25 2011-07-21 19:36:48

Guff
Member
Registered: 2009-09-30
Posts: 158
Website

Re: lualock: a silly screenlocker that's highly configurable in lua

a) is a good idea. I haven't yet come up with a good way to pause lualock, however. Currently, utils.sleep() can be used, but that halts everything, including the timers. The bigger issue is that it doesn't block input, i.e. once the process resumes, whatever keys were pressed during its slumber will get gobbled up. So, an attacker (or a bored teenager) could just hold down the enter key for a short while and lock legitimate users out of the computer for hours, because lualock would be stuck repeatedly trying to authenticate a blank password, sleeping, then repeating.

As for b) yeah, because of the drawback, I don't think it should be in the sample config. Perhaps I should include a directory with miscellaneous examples, so that potential users could get an idea of what they can do.

c): you mean record the screen, or use the webcam or something? Either way, I would have to add a hook for keypresses, as the keybinder stuff only works for specific keys. Shouldn't be too hard.

Also, I'm currently in the process of removing the dependency on clutter. Going back to cairo + gdk. Clutter is nice, and made things easier, but it also throws a whole lot of memory errors and leaks, thus making lualock extremely hard to debug. And since I really need to avoid memory leaks, debugging is essential.

Also also, I adapted awful's progressbar widget to lualock. So now, the battery indicator can be done with:

batt_box = odious.widget.progressbar{ width = 100, height = 200, x = 0.8, y = 0.1 }
batt_box:set_border_color("white"):set_vertical(true):set_color("green")

batt_timer = timer(function ()
    local batt_info = odious.util.get_battery("BAT0")
    local level = batt_info.charge_now / batt_info.charge_full
    batt_box:set_value(level)
end, 1)
batt_timer:start()

It's a bit cleaner, but also much more general.

Offline

Board footer

Powered by FluxBB