Skip to content
Oliver Webb edited this page Oct 10, 2024 · 23 revisions

Summary

Usage

  • Lock screen: $ gtklock
  • Lock screen and daemonize: $ gtklock -d
  • Specify config file: $ gtklock -c /path/to/config.ini
  • Specify style file: $ gtklock -s ./assets/example-style.css
  • Load a module: $ gtklock -m /path/to/module.so
  • Show options: $ gtklock --help-all

In general, use gtklock when manually invoking the locker, and gtklock -d when it is being automatically invoked by something like swayidle.

Config

By default gtklock will load ~/.config/gtklock/config.ini.

Available options are:

  • gtk-theme - Specify GTK theme
  • style - Specify style file
  • module - Load a module
  • time-format - Specify a strftime(3) time format for the clock

All options should be in the main group.

See ini file documentation

Example config

[main]
gtk-theme=Adwaita-dark

Styling

The best way to style gtklock is by running $ GTK_DEBUG=interactive gtklock -li and using the widget names as selectors. Some of the widgets are #window-box, #clock-label, #body, #error-label and #input-label.

Example style

window {
   background-image: url("background.png");
   background-size: cover;
   background-repeat: no-repeat;
   background-position: center;
   background-color: black;
}

The background url can be absolute or relative to the style file. If the image fails to load, the color is used.

Per output styling

Each window is named after the output, for example window#eDP-1 or window#HDMI-A-1.

A full example can be found here.

References

Fingerprint support

Add the lines to the top of /etc/pam.d/gtklock:

auth            sufficient      pam_unix.so try_first_pass likeauth nullok
auth            sufficient      pam_fprintd.so

References

Modules

Gtklock supports modules. You can load modules by running $ gtklock -m /path/to/module.so or adding modules=/path/to/module.so to your config.

Multiple modules can be included with:

modules=module1.so;module2.so;module3.so

References