cursorrecord

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: MIT, MIT Imports: 10 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 cursorrecord is the record of the cursor each user's last session showed, which the display manager keeps for the greeter. The greeter runs before anyone logs in, as an account that cannot read into a 0700 home, and a session's XDG_STATE_HOME is unknown before it starts; so the session hands its cursor to the display manager (`lys-login record-cursor`), which writes it, world-readable, under Dir by the session's uid.

Index

Constants

View Source
const Dir = "/var/lib/lys-login/cursor"

Dir is where the display manager keeps the records.

Variables

This section is empty.

Functions

func Write

func Write(dir string, uid uint32, c Cursor) (string, error)

Write replaces uid's record under dir with c, readable by every account, and returns its path.

Types

type Cursor

type Cursor struct {
	// Theme is the xcursor theme, a directory name; "" when unknown.
	Theme string `json:"theme,omitempty"`
	// Size is the nominal size in pixels, 0 when unknown.
	Size uint32 `json:"size,omitempty"`
}

Cursor is a cursor theme and size; either may be unknown, not both. Decoding one checks it, so a decoded Cursor is always one to record.

func FromEnv

func FromEnv(env xdg.Env) (Cursor, bool, error)

FromEnv is the cursor a session with environment env shows: XCURSOR_THEME, and XCURSOR_SIZE else HYPRCURSOR_SIZE, which the compositor exported. False when env names neither; an error when it names a theme that cannot be recorded.

func Read

func Read(dir string, uid uint32) (Cursor, error)

Read is uid's record under dir; an error matching fs.ErrNotExist when uid has none.

func (*Cursor) UnmarshalJSON

func (c *Cursor) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes a cursor and refuses one that cannot be recorded.

Jump to

Keyboard shortcuts

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