Go language bindings for the ext_session_lock_v1
Wayland protocol, enabling secure screen locking functionality on compositors such as Hyprland.
This project provides Go bindings and a working example client (simple_locker
) that demonstrates session locking by interfacing with the ext_session_lock_manager_v1
protocol.
- Binds to
ext_session_lock_v1
Wayland protocol - Lock session and create per-output lock surfaces
- Event handlers for lock lifecycle and surface configuration
- Simple reference implementation (
example/simple_locker
)
Found wl_compositor (name: 3)
Found ext_session_lock_manager_v1 (name: 27)
Found wl_output (name: 53)
Attempting to lock session...
Session is now locked!
-
Clone the repo:
git clone https://github.com/tuxx/wayland-ext-session-lock-go cd wayland-ext-session-lock-go
-
Build the example:
go build -o simple_locker ./example/simple_locker
-
Run it under a Wayland session with
ext_session_lock_v1
support:./simple_locker
-
Import the module:
import ext "github.com/tuxx/wayland-ext-session-lock-go"
-
Use
ext.BindSessionLockManager
to bind the protocol and create aSessionLock
. -
Register event handlers for lock state and surface configuration.
-
Create
wl.Surface
andext.SessionLockSurface
for eachwl.Output
.
See example/simple_locker/main.go
for a complete reference.
- neurlang/wayland
- Wayland compositor supporting
ext_session_lock_v1
(e.g., Hyprland)
MIT