Skip to content
Simple screen lock application for X server
Branch: master
Clone or download
Pull request Compare This branch is 63 commits ahead of mgumz:master.
pclouds and Arkq Fix padding issue on some targets
GCC reports `offset of packed bit-field ‘green’ has changed in GCC 4.4`,
because there could be padding between uint8_t on some targets prior to
gcc 4.4 [1]. Switch to uint16_t so there will be no unintentional
padding.

[1] https://www.gnu.org/software/gcc/gcc-4.4/changes.html

Fixes #10
Latest commit a4d14e4 Jan 4, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
doc Blank cursor module - hide cursor pointer Mar 16, 2016
src Fix padding issue on some targets Jan 10, 2019
.gitignore
LICENSE.txt Customize build-in default PAM service Jul 20, 2017
Makefile.am Migrating to the autotools build system Jul 22, 2014
README.md Customize build-in default PAM service Jul 20, 2017
configure.ac Customize build-in default PAM service Jul 20, 2017

README.md

ALOCK

Alock is a simple screen lock application, which locks the X server until the correct password is provided. If the authentication was successful, the X server is unlocked and the user can continue to work. When 'alock' is started it just waits for the first keypress. This first keypress is to indicate that the user now wants to type in the password. Such a behavior might seem to be annoying at the first glance, however this approach is chosen due to security reasons.

Note, that this application does not provide any fancy animations like xlock or xscreensaver and probably never will. It is just for locking current X session (with few flavors - see usage section below). If this application is too much for you, you may give a try i3lock.

Installation

$ autoreconf --install
$ mkdir build && cd build
$ ../configure --enable-pam --enable-hash --enable-xrender --enable-imlib2 \
    --with-dunst --with-xbacklight
$ make && make install

Integration with external applications (experimental features):

  • --with-dunst - This option enables the integration with the dunst (lightweight notification-daemon). When the screen is locked, the notifications are paused in order to prevent the leak of confidential data.
  • --with-xbacklight - Enable display backlight dimming via the xbacklight. When the screen is locked, the backlight brightness is set to 0. The original (previous) value is restored whenever the screen is going to be unlocked (passphrase input). This feature has to be explicitly enabled via the ALock.backlight: true X Resource.

In order to specify the build-in default PAM service, use PAM_DEFAULT_SERVICE environment variable (or pass it as a configuration argument). If this variable is empty or not specified, the system-auth service will be used.

Usage

The locking behavior can be customized with four 'alock' modules: authentication (-auth), background (-bg), cursor (-cursor) and input module (-input). In order to obtain the list of all available modules (compiled in), issue the command as follows:

$ alock --modules

When 'alock' is compiled with all modules, then running it without any arguments is equivalent to:

$ alock -auth pam -bg blank:color=black -cursor none \
        -input frame:input=green,check=yellow,error=red

It is also possible to modify visual behavior of background, cursor and input modules via the X Resources. All available resource names can be found in the 'alock' manual file. The exemplary configuration might be as follows:

ALock*background*option:  center
ALock*background*shade:   50
ALock*cursor*name:        plus
ALock*input.frame*input:  white
ALock*input.frame*check:  blue
ALock*backlight:          true

Available modules

List of authentication modules:

  • none - no authentication at all (not recommended)
  • pam - authenticate using the 'pam-login' module
  • passwd - authenticate using system password database
  • hash - authenticate using arbitrary hash comparison

List of background modules:

  • none - transparent background
  • blank - fill the background with color
  • shade - dim content of the screen
  • image - use image as a background

List of cursor modules:

  • none - no change to the current cursor
  • blank - hide cursor pointer
  • glyph - use compiled in glyph
  • xcursor - use xcursor file
  • image - use image

List of input modules:

  • none - no input feedback for user
  • frame - display frame on the current display
You can’t perform that action at this time.