feat(desktop): consolidate declarative workstation profile

Capture desktop-specific system, session, Noctalia, and Pi integration alongside shared laptop support. Retire obsolete X11 configuration and make package ownership explicit for repeatable Decman deployments.
This commit is contained in:
2026-08-24 20:20:58 +02:00
parent bfc5aa7933
commit ed063ab1fe
105 changed files with 1479 additions and 8826 deletions
@@ -0,0 +1,59 @@
#!/usr/bin/env python3
"""Validate a vault path and resolve its registered Obsidian vault ID."""
from __future__ import annotations
import json
import sys
from pathlib import Path
OBSIDIAN_CONFIG = Path.home() / ".config" / "obsidian" / "obsidian.json"
def fail(message: str) -> int:
json.dump({"ok": False, "error": message}, sys.stdout)
return 1
def main() -> int:
if len(sys.argv) != 2:
return fail("No vault directory is configured")
raw_path = sys.argv[1].strip()
if not raw_path:
return fail("No vault directory is configured")
vault = Path(raw_path).expanduser().resolve()
if not vault.is_dir():
return fail(f"Vault directory was not found: {vault}")
vault_id: str | None = None
config_error: str | None = None
try:
config = json.loads(OBSIDIAN_CONFIG.read_text(encoding="utf-8"))
for registered_id, metadata in config.get("vaults", {}).items():
registered_path = Path(str(metadata.get("path", ""))).expanduser().resolve()
if registered_path == vault:
vault_id = str(registered_id)
break
except FileNotFoundError:
config_error = "Obsidian has not registered any vaults yet"
except (OSError, json.JSONDecodeError, TypeError) as error:
config_error = f"Cannot read Obsidian vault registration: {error}"
response = {
"ok": True,
"path": str(vault),
"name": vault.name,
"vaultId": vault_id,
"obsidianError": config_error
or (
None
if vault_id
else "This directory is not registered as an Obsidian vault"
),
}
json.dump(response, sys.stdout)
return 0
if __name__ == "__main__":
raise SystemExit(main())