mirror of
https://git.srhtnin.garden/sarah/SaraSort.git
synced 2026-10-14 18:48:11 +02:00
SaraSortd's service without systemd (runit, OpenRC, ...)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
826216cd03
commit
b5d2fe0f1c
5 files changed
+137
-64
No files matched your search
@@ -6,6 +6,7 @@ one Sara program looks the same in all of them.
|
||||
"""
|
||||
|
||||
import os
|
||||
import shutil
|
||||
import sys
|
||||
from dataclasses import asdict, dataclass
|
||||
from pathlib import Path
|
||||
@@ -31,6 +32,13 @@ else:
|
||||
ConfigHome = Path(os.environ.get("XDG_CONFIG_HOME") or Home / ".config")
|
||||
DataHome = Path(os.environ.get("XDG_DATA_HOME") or Home / ".local" / "share")
|
||||
|
||||
# Linux: whether systemd runs the system (and so SaraSortd's --user unit),
|
||||
# the same check as SaraSuite's. Without it (runit on Void, OpenRC, ...),
|
||||
# SaraSuite runs SaraSortd itself, the way it does on Windows (Service.py).
|
||||
HasSystemd = not IsWindows and Path("/run/systemd/system").is_dir() and shutil.which("systemctl") is not None
|
||||
RunBySaraSuite = IsWindows or not HasSystemd
|
||||
AutostartDir = ConfigHome / "autostart"
|
||||
|
||||
SharedConfigDir = ConfigHome / "SaraSuite"
|
||||
ThemesDir = SharedConfigDir / "Themes"
|
||||
SharedConfigPath = SharedConfigDir / "Config.toml"
|
||||
|
||||
Reference in new issue
Block a user