photon_platform.clerk.service¶
Declarative systemd --user and XDG .desktop service manager for PHOTON web apps.
Functions¶
|
Return |
|
Return |
|
Render an unprivileged |
|
Render an XDG |
|
Inspect installation and live |
|
Write |
|
Disable, stop, and remove the |
|
Run |
|
Fetch recent |
|
Combine systemd status, live TCP port reachability, and command interpreter check. |
|
Install systemd units and |
|
Launch or raise |
|
Serialize service specifications to a clean documented |
|
Manage persistent |
Module Contents¶
- photon_platform.clerk.service.default_systemd_user_dir() pathlib.Path¶
Return
~/.config/systemd/user(honoringXDG_CONFIG_HOME).
- photon_platform.clerk.service.default_applications_dir() pathlib.Path¶
Return
~/.local/share/applications(honoringXDG_DATA_HOME).
- photon_platform.clerk.service.render_systemd_unit(spec: photon_platform.clerk.config.ServiceSpec) str¶
Render an unprivileged
systemd --userunit file forspec.- Parameters:
spec – Declarative
ServiceSpec.- Returns:
Formatted INI unit file text.
- photon_platform.clerk.service.render_desktop_entry(spec: photon_platform.clerk.config.ServiceSpec, *, launcher_bin: str | None = None) str¶
Render an XDG
.desktopfile for Pop!_OS Super launcher and Alt-Tab identity.- Parameters:
spec – Declarative
ServiceSpec.launcher_bin – Explicit path to
photon-app(defaults to~/.local/bin/photon-app).
- Returns:
Formatted
.desktopfile text.
- photon_platform.clerk.service.service_status(service_id: str, *, systemd_dir: pathlib.Path | None = None) dict[str, Any]¶
Inspect installation and live
systemd --userstatus forservice_id.
- photon_platform.clerk.service.install_service(spec: photon_platform.clerk.config.ServiceSpec, *, systemd_dir: pathlib.Path | None = None, applications_dir: pathlib.Path | None = None, enable: bool = True, start: bool = True, dry_run: bool = False) dict[str, Any]¶
Write
.serviceand.desktopfiles forspecand optionally enable/start it.
- photon_platform.clerk.service.uninstall_service(service_id: str, *, systemd_dir: pathlib.Path | None = None, applications_dir: pathlib.Path | None = None, dry_run: bool = False) dict[str, Any]¶
Disable, stop, and remove the
.serviceand.desktopfiles forservice_id.
- photon_platform.clerk.service.control_service(service_id: str, verb: str) dict[str, Any]¶
Run
systemctl --user <verb> <service_id>.service.
- photon_platform.clerk.service.service_logs(service_id: str, *, lines: int = 80) dict[str, Any]¶
Fetch recent
journalctl --userlogs forservice_id.
- photon_platform.clerk.service.probe_service_health(spec: photon_platform.clerk.config.ServiceSpec, *, systemd_dir: pathlib.Path | None = None) dict[str, Any]¶
Combine systemd status, live TCP port reachability, and command interpreter check.
- photon_platform.clerk.service.install_all_services(*, config: photon_platform.clerk.config.ClerkConfig | None = None, systemd_dir: pathlib.Path | None = None, applications_dir: pathlib.Path | None = None, enable: bool = True, start: bool = True, dry_run: bool = False) list[dict[str, Any]]¶
Install systemd units and
.desktoplaunchers for every discovered PHOTON service.
- photon_platform.clerk.service.launch_service_window(spec: photon_platform.clerk.config.ServiceSpec, *, new_window: bool = False, detach: bool = True, launcher_bin: str | None = None) dict[str, Any]¶
Launch or raise
specinside a standalone GTK3/WebKit2GTKphoton-appwindow.
- photon_platform.clerk.service.render_services_toml(specs: list[photon_platform.clerk.config.ServiceSpec]) str¶
Serialize service specifications to a clean documented
services.tomlfile.