Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
33c5361
add layout loading
jovanlanik Jun 1, 2023
d7d2fa4
update makefile
jovanlanik Aug 21, 2023
6f0e0c8
Wait for activation before detaching
jovanlanik Sep 20, 2023
e7f929d
Introduce meson build system
lujianhua Nov 7, 2023
a607326
add .clangd in order to clangd search compile_commands.json under bui…
lujianhua Nov 8, 2023
6523dbc
Merge pull request #73 from lujianhua/meson
jovanlanik Nov 8, 2023
425967d
update
jovanlanik Nov 8, 2023
1ce8c44
remove makefile
jovanlanik Nov 8, 2023
5822016
change build to builddir
jovanlanik Nov 8, 2023
9cf439d
format
jovanlanik Nov 8, 2023
763164f
split man build into separate file
jovanlanik Nov 8, 2023
b3f112a
add header to meson files
jovanlanik Nov 8, 2023
6667490
update readme
jovanlanik Nov 8, 2023
6732a03
Merge pull request #74 from jovanlanik/meson
jovanlanik Nov 8, 2023
c3662ae
initial impl of ext-session-lock
jovanlanik Apr 7, 2024
0f2e1c5
update
jovanlanik Apr 15, 2024
9a9cd54
remove idle-inhibitor
jovanlanik Apr 17, 2024
576b235
update readme
jovanlanik Apr 17, 2024
3bd5fcb
exec lock command after locking and creating surfaces
jovanlanik Apr 17, 2024
c219937
update module support
jovanlanik Apr 17, 2024
3345b04
update
jovanlanik Apr 17, 2024
b4de93e
add monitor priority option
jovanlanik Apr 17, 2024
f1e08f8
hide cursor when idle
jovanlanik Apr 17, 2024
c614171
fix regression
jovanlanik Apr 17, 2024
30b5389
Merge pull request #88 from jovanlanik/session-lock
jovanlanik Apr 18, 2024
159592e
update --lock-command
jovanlanik Apr 18, 2024
48001a2
update docs
jovanlanik Apr 18, 2024
feec977
update readme
jovanlanik Apr 22, 2024
cd4c45f
build: fetch gtk-session-lock as a subproject when not present on system
mochaaP Apr 21, 2024
0409880
modules: handle multiarch systems' libdir
mochaaP Apr 21, 2024
5c932fb
Merge pull request #90 from mcha-forks/master
jovanlanik May 17, 2024
34c7d43
suppress contex menu on entry
jovanlanik Jun 7, 2024
d22127f
auth: guard against race condition with messages
mochaaP Jun 22, 2024
8c28731
Merge pull request #95 from mcha-forks/master
jovanlanik Jun 22, 2024
35a8fdb
feat: date module
bhaskarkhoraja Jun 20, 2024
ffd59ce
update date feature
jovanlanik Jun 26, 2024
5b564d3
add follow focus option
jovanlanik Jun 26, 2024
fff27ce
add support for translation
jovanlanik Jun 27, 2024
e502b3f
update readme
jovanlanik Jun 28, 2024
f5b624d
update comments
jovanlanik Jul 3, 2024
58193b2
Added german translation for gtklock
werdahias Jul 6, 2024
332aac5
Merge pull request #97 from werdahias/po-german
jovanlanik Jul 7, 2024
7b016fd
add serbian translation
jovanlanik Jul 7, 2024
e0e7f6d
update
jovanlanik Jul 16, 2024
1bb27d3
Update installation instructions with the official Arch packages
Antiz96 Aug 24, 2024
76ec411
Merge pull request #103 from Antiz96/arch-repo
jovanlanik Aug 24, 2024
10afe99
add gtk-session-lock lock signal handlers
jovanlanik Sep 26, 2024
eff6868
exec lock-command only after receiving gtk-session-lock lock signal
jovanlanik Sep 27, 2024
e1ba618
update
jovanlanik Oct 21, 2024
66321fb
update
jovanlanik Oct 21, 2024
d44edbd
Merge tag 'v4.0.0' into packaging/v4.0.0
SoumyaRanjanPatnaik Feb 20, 2026
7987c03
chore: update package dependencies
SoumyaRanjanPatnaik Feb 20, 2026
757d7b3
chore: ignore .github/ workflows
SoumyaRanjanPatnaik Feb 20, 2026
eef0e85
chore: move auth.c changes to debian patch
SoumyaRanjanPatnaik Feb 20, 2026
d24b5ff
chore: update changelogs
SoumyaRanjanPatnaik Feb 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .clangd
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CompileFlags:
CompilationDatabase: builddir/ # Search builddir/ directory for compile_commands.json
11 changes: 2 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,2 @@
/build/
/.cache/
/gtklock
/gtklock.1
compile_flags.txt
compile_commands.json
*-client-protocol.h
*-client-protocol.c
*.o
/builddir/
/subprojects/*/
30 changes: 16 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,38 @@ GTK-based lockscreen for Wayland.
![screenshot](https://user-images.githubusercontent.com/21199271/169707623-2ac5f02b-b6ed-461a-b9a3-5d96440843a2.png)
## About
gtklock is a lockscreen based on [gtkgreet](https://git.sr.ht/~kennylevinsen/gtkgreet).
It uses the wlr-layer-shell and wlr-input-inhibitor Wayland protocols.
It uses the ext-session-lock Wayland protocol.
Works on sway and other wlroots-based compositors.

ℹ️ __For documentation, check out the [man page](https://man.voidlinux.org/gtklock) and [wiki](https://github.com/jovanlanik/gtklock/wiki).__

Available on these repositories:

## Installing gtklock from a repository
gtklock is available on these repositories:

[![Packaging status](https://repology.org/badge/vertical-allrepos/gtklock.svg)](https://repology.org/project/gtklock/versions)
### Installing gtklock
- Arch: `# yay -S gtklock` (using [Yay](https://github.com/Jguer/yay))

- Arch: `# pacman -S gtklock`
- Gentoo: `# emerge --ask gui-apps/gtklock` (in [GURU repository](https://wiki.gentoo.org/wiki/Project:GURU))
- Void: `# xbps-install gtklock`

❤️ __Please submit an installation command for your distro!__
## Building from source
```
$ make
# make install
$ meson setup builddir
$ ninja -C builddir
# meson install -C builddir
```
### Dependencies
- GNU Make (build-time)
- Meson (build-time)
- pkg-config (build-time)
- scdoc (build-time)
- scdoc (optional, build-time)
- PAM
- wayland-client
- gtk+3.0
- gtk-layer-shell
### Install dependencies
- Arch: `# pacman -S gcc make pkgconf scdoc pam wayland gtk3 gtk-layer-shell`
- Fedora: `# dnf install gcc make pkgconf scdoc pam-devel wayland-devel gtk3-devel gtk-layer-shell-devel`
- Void: `# xbps-install gcc make pkgconf scdoc pam-devel wayland-devel gtk+3-devel gtk-layer-shell-devel`
- [gtk-session-lock](https://github.com/Cu3PO42/gtk-session-lock)
### Installing build dependencies
- Arch: `# pacman -S gcc meson pkgconf scdoc pam wayland gtk3 gtk-session-lock`
- Fedora: `# dnf install gcc meson pkgconf scdoc pam-devel wayland-devel gtk3-devel`, install gtk-session-lock manually
- Void: `# xbps-install gcc meson pkgconf scdoc pam-devel wayland-devel gtk+3-devel gtk-session-lock-devel`

❤️ __Please submit an dependency installation command for your distro!__
48 changes: 48 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,51 @@
gtklock (4.0.0-1) UNRELEASED; urgency=medium

[ Jovan Lanik ]
* add layout loading
* Wait for activation before detaching
* remove makefile
* change build to builddir
* split man build into separate file
* add header to meson files
* initial impl of ext-session-lock
* remove idle-inhibitor
* exec lock command after locking and creating surfaces
* update module support
* add monitor priority option
* hide cursor when idle
* fix regression
* update --lock-command
* suppress contex menu on entry
* update date feature
* add follow focus option
* add support for translation
* add serbian translation
* add gtk-session-lock lock signal handlers
* exec lock-command only after receiving gtk-session-lock lock signal

[ Jianhua Lu ]
* Introduce meson build system
* add .clangd in order to clangd search compile_commands.json under build directory

[ Zephyr Lykos ]
* build: fetch gtk-session-lock as a subproject when not present on system
* modules: handle multiarch systems' libdir
* auth: guard against race condition with messages

[ Bhaskar Khoraja ]
* feat: date module

[ Matthias Geiger ]
* Added german translation for gtklock

[ Robin Candau ]
* Update installation instructions with the official Arch packages gtklock and all its build dependencies are now in the official Arch [extra] repository. This commit updates the installation instructions accordingly.

[ Soumya Ranjan Patnaik ]
* chore: update package dependencies

-- Soumya Ranjan Patnaik <soumyaranjan1812@gmail.com> Fri, 20 Feb 2026 16:28:34 +0530

gtklock (2.2.2) focal; urgency=medium

[ Khosrow Moossavi ]
Expand Down
8 changes: 7 additions & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,15 @@ Maintainer: Soumya Ranjan Patnaik <soumyaranjan1812@gmail.com>
Rules-Requires-Root: no
Build-Depends:
debhelper-compat (= 11),
meson,
cmake,
build-essential,
libgtk-layer-shell0,
libgtk-layer-shell-dev,
libgtk-session-lock-dev,
pkg-config,
libpam0g-dev,
libaudit-dev,
libgtk-3-0,
libgtk-3-dev,
gir1.2-gtklayershell-0.1,
Expand All @@ -24,7 +29,8 @@ Depends:
${misc:Depends},
libpam0g,
libgtk-layer-shell0,
libgtk-session-lock0,
libgtk-3-0
Description: GTK-based lockscreen for Wayland. Works
Description: GTK-based lockscreen for Wayland. Works
on sway and other wlroots-based compositors.

28 changes: 28 additions & 0 deletions debian/patches/01-suppress-unused-return-warning.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Description: Suppress compiler warnings about ignoring return values of write and fopen in auth.c
Author: Soumya Ranjan Patnaik <soumyaranjan1812@gmail.com>

---
Last-Update: 2026-02-20

--- gtklock-4.0.0.orig/src/auth.c
+++ gtklock-4.0.0/src/auth.c
@@ -36,8 +36,8 @@ char *auth_get_message(void) {

static void send_msg(const char *msg, int fd) {
size_t len = strlen(msg);
- write(fd, &len, sizeof(size_t));
- write(fd, msg, len);
+ (void)!write(fd, &len, sizeof(size_t));
+ (void)!write(fd, msg, len);
}

static int conversation(
@@ -133,7 +133,7 @@ enum pwcheck auth_pw_check(const char *s
else if(pid == 0) {
close(err_pipe[PIPE_PARENT]);
close(out_pipe[PIPE_PARENT]);
- freopen("/dev/null", "r", stdin);
+ (void)!freopen("/dev/null", "r", stdin);
auth_child(s, err_pipe, out_pipe);
}
close(err_pipe[PIPE_CHILD]);
1 change: 1 addition & 0 deletions debian/patches/series
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
01-suppress-unused-return-warning.patch
2 changes: 2 additions & 0 deletions debian/source/options
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Ignore .github, and local changes to src/auth.c
extend-diff-ignore = "\.github"
19 changes: 13 additions & 6 deletions include/gtklock.h
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
// gtklock
// Copyright (c) 2022 Kenny Levinsen, Jovan Lanik
// Copyright (c) 2022 Kenny Levinsen, Jovan Lanik, Bhaskar Khoraja

// gtklock application

#pragma once

#include <gtk/gtk.h>
#include <gtk-session-lock.h>

struct Window;

struct GtkLock {
GtkApplication *app;
GtkSessionLockLock *lock;
pid_t parent;

GArray *windows;
GArray *messages;
GArray *errors;
Expand All @@ -19,27 +23,30 @@ struct GtkLock {
gboolean hidden;
guint idle_timeout;

guint draw_clock_source;
guint draw_time_source;
guint idle_hide_source;

gboolean use_layer_shell;
gboolean use_input_inhibit;
gboolean follow_focus;
gboolean use_idle_hide;

char *time;
char *date;
char *time_format;
char *date_format;
char *config_path;
char *layout_path;
char *lock_command;
char *unlock_command;

GArray *modules;
};

void gtklock_remove_window(struct GtkLock *gtklock, struct Window *win);
void gtklock_focus_window(struct GtkLock *gtklock, struct Window *win);
void gtklock_update_clocks(struct GtkLock *gtklock);
void gtklock_update_dates(struct GtkLock *gtklock);
void gtklock_idle_hide(struct GtkLock *gtklock);
void gtklock_idle_show(struct GtkLock *gtklock);
struct GtkLock *create_gtklock(void);
void gtklock_activate(struct GtkLock *gtklock);
void gtklock_shutdown(struct GtkLock *gtklock);
void gtklock_destroy(struct GtkLock *gtklock);

10 changes: 0 additions & 10 deletions include/input-inhibitor.h

This file was deleted.

1 change: 1 addition & 0 deletions include/module.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

GModule *module_load(const char *name);
void module_on_activation(struct GtkLock *gtklock);
void module_on_locked(struct GtkLock *gtklock);
void module_on_output_change(struct GtkLock *gtklock);
void module_on_focus_change(struct GtkLock *gtklock, struct Window *win, struct Window *old);
void module_on_idle_hide(struct GtkLock *gtklock);
Expand Down
11 changes: 8 additions & 3 deletions include/window.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// gtklock
// Copyright (c) 2022 Kenny Levinsen, Jovan Lanik
// Copyright (c) 2022 Kenny Levinsen, Jovan Lanik, Bhaskar Khoraja

// Window functions

Expand All @@ -17,22 +17,27 @@ struct Window {
GtkWidget *body_grid;
GtkWidget *input_label;
GtkWidget *input_field;
GtkWidget *message_revealer;
GtkWidget *message_scrolled_window;
GtkWidget *message_box;
GtkWidget *unlock_button;
GtkWidget *error_label;
GtkWidget *warning_label;
GtkWidget *info_box;
GtkWidget *time_box;
GtkWidget *clock_label;

gulong enter_notify_handler;
GtkWidget *date_label;

void *module_data[];
};

struct Window *window_by_widget(GtkWidget *window);
struct Window *window_by_monitor(GdkMonitor *monitor);
struct Window *window_last_active(void);
struct Window *create_window(GdkMonitor *monitor);
void window_idle_hide(struct Window *win);
void window_idle_show(struct Window *win);
void window_update_clock(struct Window *ctx);
void window_update_date(struct Window *ctx);
void window_swap_focus(struct Window *win, struct Window *old);

93 changes: 0 additions & 93 deletions makefile

This file was deleted.

Loading
Loading