slock - X display locker

Antivirus, forensics, intrusion detection, cryptography, etc.
Post Reply
Message
Author
aragon
Posts: 1698
Joined: Mon 15 Oct 2007, 12:18
Location: Germany

slock - X display locker

#1 Post by aragon »

Home: http://www.suckless.org/programs/slock.html
Version: 0.9
Simple X display locker. Really this is the simplest X screen locker we are aware of. It is stable and quite a lot people in this community are using it every day when they are out with friends or fetching some food from the local pub.
Usage is simple, open a console and type 'slock'. To get back, type your pw (only type and return, no inputbox).

NOTE: This uses the user-pw, in puppy-case the pw for root. In 4.00 default-pw is 'woofwoof'. If you're wrong retry or reboot.

USE AT YOUR OWN RISK.

If you want an advanced version, try pupslock by goingnuts: http://www.murga-linux.com/puppy/viewtopic.php?t=70827

Cheers
aragon
Attachments
slock-0.9.pet
(3.65 KiB) Downloaded 1371 times
Last edited by aragon on Wed 17 Aug 2011, 07:42, edited 1 time in total.

106498
Posts: 250
Joined: Mon 19 Nov 2007, 02:07
Location: NZ
Contact:

#2 Post by 106498 »

Thank you kind sir, I was looking for this!
[color=green]An expert is just a beginner with experience.[/color]
Shamelessly representing [url=http://www.tdem.co.nz]TdeM[/url]!

goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

slock - with image

#3 Post by goingnuts »

slock is really a nice and tiny app.! I have been using it for a while but was missing some indication of it running...
So I modified the source to show an image - view below. The binary is in the attached tar.gz-file + a source-code-patch-file.
Attachments
slock-with-image.png
(5.46 KiB) Downloaded 6730 times
slock-0.9-patched.tar.gz
modified slock incl. patch.
(12.85 KiB) Downloaded 1099 times

aragon
Posts: 1698
Joined: Mon 15 Oct 2007, 12:18
Location: Germany

#4 Post by aragon »

hi goingnuts,

nice one ;-) (although some might say, it's a security-feature that there is no indication of it's running).

thanks
aragon

User avatar
cimarron
Posts: 292
Joined: Fri 31 May 2013, 01:57

#5 Post by cimarron »

Nice and simple. One little thing maybe worth adding is to disable the Ctrl keys, so Ctrl-Alt-F2 (etc.) and Ctrl-Alt-Bksp can't be used to get around the lock. Lobster added that functionality to xlock. To use it with slock, just launch slock with a script like this:

Code: Select all

#!/bin/sh
#runs slock

# disable ctrl-alt-backspace by disabling ctrl key...
xmodmap -e 'keycode 37='
xmodmap -e 'keycode 109='

slock

# restore...
xmodmap -e 'keycode 37=Control_L'
xmodmap -e 'keycode 109=Control_R'
I called it "lock," put it in /usr/local/bin, and gave it execute permissions. Works great. Just use the command "lock" instead of "slock".

goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

#6 Post by goingnuts »

Please view 8)

User avatar
cimarron
Posts: 292
Joined: Fri 31 May 2013, 01:57

#7 Post by cimarron »

Using a newer (only 11 year old) Dell today I found that the slock from this thread did not work properly. It would not come out of the lock (at least not without considerable difficulty).

So I tried compiling newer versions of slock and they worked properly. Below is slock version 1.0, and the newest, 1.2. In version 1.2, the screen changes to a blue color when you start typing. In 1.0, the screen remains black when you type (which I prefer).

These were compiled in Precise pup, and are just the slock binary. Just remove the fake .gz extension and change the name to slock (or whatever name you want to execute it) and place in /usr/bin. Slock uses the system password, and you must hit enter after the password. (It's usually woofwoof by default unless you've changed it.)

The script I posted above can be used to disable the CTRL keys that could be used to easily get around the lock.
Attachments
slock-1.2.gz
remove the fake .gz extension and version number
(9.56 KiB) Downloaded 452 times
slock-1.0.gz
remove the fake .gz extension and version number
(9.54 KiB) Downloaded 432 times

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#8 Post by don570 »

It's possible to change the color from blue to another color at the time of compiling. Explained here

___________________________________________

I wrote a wrapper script to make it a bit easier to use.
http://www.murga-linux.com/puppy/viewtopic.php?t=80622

User avatar
cimarron
Posts: 292
Joined: Fri 31 May 2013, 01:57

#9 Post by cimarron »

Hmm. Those cppflags for color aren't in the config.mk file for the slock versions I looked at. But maybe they would still work if added.

The location for the source code is: http://tools.suckless.org/slock/

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#10 Post by don570 »

Perhaps in the configure file there is a mention of DCOLOR1 and DCOLOR2 ???
If there is then there is possibility of changing before 'make' command.

I'll have a look when I'm back home.

_________________________________

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#11 Post by don570 »

I think I found the way to make the COLOR2 black 8)

Open up slock.c file
Go to line 215
and fool the compiler

Code: Select all

XAllocNamedColor(dpy, DefaultColormap(dpy, lock->screen), COLOR2, &color, &dummy);
switch to

Code: Select all

XAllocNamedColor(dpy, DefaultColormap(dpy, lock->screen), COLOR1, &color, &dummy);
________________________________________________

Post Reply