Skip to content

guardian_agent

Modules:

  • lock_events

    Guardian Agent: Tracks KDE screen lock/unlock events and sends them to the daemon via D-Bus IPC.

  • logging

    Guardian logging setup module.

lock_events

Guardian Agent: Tracks KDE screen lock/unlock events and sends them to the daemon via D-Bus IPC.

Classes:

LockEventReporter

LockEventReporter(
    session_id, username, system_bus, session_bus
)

Methods:

  • listen_kde_locks

    Listen for KDE lock/unlock events via DBus and send to daemon.

  • send_lock_event

    Send lock/unlock event to daemon via D-Bus IPC, with deduplication.

listen_kde_locks async

listen_kde_locks()

Listen for KDE lock/unlock events via DBus and send to daemon.

send_lock_event async

send_lock_event(locked: bool)

Send lock/unlock event to daemon via D-Bus IPC, with deduplication. Ignores systemd-user sessions.

logging

Guardian logging setup module. Configures log level, format, and target based on config.yaml/default-config.yaml.

Functions:

  • load_logging_config

    Loads logging configuration from config.yaml or default-config.yaml.

  • setup_logging

    Sets up structlog and stdlib logging according to config.

load_logging_config

load_logging_config()

Loads logging configuration from config.yaml or default-config.yaml. Returns dict with level, format, target from the 'logging' section.

setup_logging

setup_logging()

Sets up structlog and stdlib logging according to config.