lockclient

package
v0.3.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 3, 2026 License: MIT Imports: 15 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package lockclient is the shell's side of locking: it owns the triggers (logind's Lock signal, `lys-shell lock`, lock-on-start, and a lock found held at startup) and answers each by starting `lys-login lock`, the login screen in its lock mode, as a process of its own. The shell links no lock screen code; the lock outlives a shell restart in a scope of its own, and a lock process that dies with the session still locked is started again.

Index

Constants

View Source
const (
	LockedLine = "locked"
	// ExitHeld: another lys-login already holds the session locked.
	ExitHeld = 3
	// ExitRefused: the lock never took (disabled, or the compositor
	// refused it).
	ExitRefused = 4
)

The `lys-login lock` contract: the line it prints on stdout once the compositor confirms the lock, and its exit codes beyond 0 (unlocked) and 1 (failed).

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client starts and follows the lock process.

func New

func New(enabled func() bool, onLocked func(), locked func() (bool, error)) *Client

New is a client for the lys-login on the PATH, which lys-login's own package installs.

func Start

func Start(current func() *config.Config, onLocked func()) (*Client, func())

Start runs the triggers for a shell: logind's Lock signal, a lock found held at startup (a lock client that died with the session locked), and lock-on-start once per login session. It returns the client, for `lys-shell lock`, and the stop that ends the logind listener.

func (*Client) Lock

func (c *Client) Lock()

Lock starts a lock process unless one this client started runs, or locking is disabled in the config.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL