session-unit-order
Skill2 starsChanged 40 days agoMITView on GitHub
Prevents user-systemd / UWSM / Hyprland first-login failures caused by pulling graphical-session (or compositor) targets from Persistent timers under Linger. On Omarchy-flavoured Arch (Hyprland + omarchy CLI + ~/.config/omarchy), ALSO load the omarchy skill for safe config/theme paths. Use when editing systemd user units, eye-comfort timers/services, theme oneshots, SDDM/UWSM/Hyprland session startup, WantedBy/Wants graphical-session, Omarchy theme timers/hooks, or diagnosing first boot after shutdown fails / "compositor or graphical-session target is already active" / blank desktop until hard reboot.
In this repository49 other files it gives its agents.
- AGENTS.mdAGENTS.md
- adversarial-auditSkill
- agentic-reactorSkill
- agent-orchestratorSkill
- ai-optimizationSkill
- architecture-synthesisSkill
- audit-allow-buildsSkill
- audit-ide-dependenciesSkill
- author-workflow-skillSkill
- bdd-strategizerSkill
- chrome-extension-mv3Skill
- concurrent-cli-agentsSkill
- control-feederSkill
- control-graphSkill
- cursor-transcript-harvestSkill
- cv-promote-guardSkill
- devcontainer-hardenedSkill
- dual-copy-skill-publishSkill
- explore-repo-readonlySkill
- finder-reactorSkill
- fix-dependency-securitySkill
- fusion-sageSkill
- git-worktreesSkill
- grok-host-prepSkill
- gt-flowSkill
- higher-order-decision-architectSkill
- looperSkill
- master-plannerSkill
- mvu-refactor-planSkill
- odysseus-navigatorSkill
- project-editor-profileSkill
- react-client-expertSkill
- semantic-markup-cssSkill
- semantic-nameSkill
- shell-kernel-ontologySkill
- skill-rename-propagationSkill
- split-to-prsSkill
- src-tree-reorganizeSkill
- stellar-roadmapSkill
- stellar-spacemapSkill
- subagent-delegationSkill
- subagent-explore-reportSkill
- supply-chain-hardenSkill
- tauri-agenticSkill
- tauri-ipc-debugSkill
- tidy-commit-pushSkill
- upgrade-packagesSkill
- verification-cockpitSkill
- x-agent-resourcesSkill
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 2 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 35
Install: keep full tree in-repo (e.g.
- Very specific: line 41
If the host is Omarchy (or Omarchy-style Arch: Hyprland session, omarchy CLI, ~/.config/omarchy/, ~/.local/share/omarchy/), agents must …
- Very specific: line 68
Prefer omarchy theme set / omarchy restart waybar / omarchy commands over hand-restarting Omarchy-managed processes when a stock command …
- Very specific: line 71
After Hyprland config edits: hyprctl reload + hyprctl configerrors.
- Very specific: line 78
arch-machine: keep skill in-tree under .agents/skills/session-unit-order/.
- Very specific: line 90
Do not add these on timer-driven oneshots (or any unit that can start before a compositor under loginctl Linger):
- Very specific: line 130
Omarchy?: If yes → load omarchy skill.
- Distinctive: line 140
Run closed-loop unit tests: when eye-comfort units change (in arch-machine):
- Very specific: line 151
Linger awareness: if loginctl show-user "$USER" -p Linger is yes, assume user timers can run before SDDM/UWSM.
- Distinctive: line 152
Do not: use hard-reboot loops as proof.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Session unit order (UWSM / graphical-session guard)
Load rule: Formal forbid/safe tables below are SoT. Omarchy companion depth stays here (host-critical). Dual-publish of this project-born skill → dual-copy-skill-publish (not portable-symlink).
// Signature
UnitOrder ≔ user-systemd + UWSM + graphical-session safety
Kind ≔ project_born // keep in project git; library via dual-copy only
Host ∈ { generic_uwsm, omarchy } // Omarchy → also load omarchy skill
// Axioms
A1 After= ≇ Wants=/Requires=/BindsTo= // order ≠ pull
A2 Persistent timer under Linger ⇏ pull graphical-session / compositor targets
A3 Omarchy: never edit ~/.local/share/omarchy/ — hooks/themes under ~/.config/
A4 Evidence ≻ hard-reboot loops // unit tests + journal fingerprint
A5 Project-born: dual-copy-skill-publish to library — never external-only symlink that drops project git
A6 Evaluate(δ) ≔ (C, E, η)Agents must apply this skill before shipping changes to user systemd units that interact with Wayland sessions, theme apply, or autostart.
Install: keep full tree in-repo (e.g. arch-machine/.agents/skills/session-unit-order/). Publish/sync → dual-copy-skill-publish.
Incident: arch-machine modules/productivity/eye-comfort/docs/REGRESSION-UWSM-SESSION.md · short: references/incident-uwsm-graphical-session.md.
Omarchy-flavoured Arch (REQUIRED companion)
If the host is Omarchy (or Omarchy-style Arch: Hyprland session, omarchy CLI, ~/.config/omarchy/, ~/.local/share/omarchy/), agents must also load the omarchy skill and follow it for desktop/theme config work.
| Detect Omarchy | How |
| CLI present | command -v omarchy |
| User config tree | test -d ~/.config/omarchy |
| Install tree (read-only) | test -d ~/.local/share/omarchy |
| Session path | SDDM → uwsm start … hyprland / Omarchy desktop entry |
Where omarchy lives (typical):
- Skill:
~/.agents/skills/omarchy→~/.local/share/omarchy/default/omarchy-skill/SKILL.md - Or under the tools that symlink it (Cursor/Grok agents skills dirs)
When both skills apply
| Work | Load |
User systemd units, timers, Wants=graphical-session, first-boot/UWSM race | session-unit-order (this skill) |
Themes, waybar/hypr/ghostty configs, omarchy theme/restart/refresh, hooks under ~/.config/omarchy/ | omarchy first, then this skill if units/timers are involved |
| eye-comfort install + timers on Omarchy | both — omarchy for safe paths; this skill for unit order |
Omarchy rules this skill re-asserts (do not bypass)
From the omarchy skill — non-negotiable when the host is Omarchy:
- Never edit
~/.local/share/omarchy/(read-only; lost onomarchy update). User themes/hooks live under~/.config/omarchy/and~/.config/. - Prefer
omarchy theme set/omarchy restart waybar/omarchy commandsover hand-restarting Omarchy-managed processes when a stock command exists. - Theme automation:
~/.config/omarchy/hooks/(e.g.theme-set,theme-set.d/) — not patches under the install tree. - Custom themes: real directories under
~/.config/omarchy/themes/<name>/. - After Hyprland config edits:
hyprctl reload+hyprctl configerrors. Waybar:omarchy restart waybar(no auto-reload). - Set
OMARCHY_PATH(usually%h/.local/share/omarchy) in timer/oneshot env when callingomarchy-theme-set/ template generation socurrent/theme/hyprland.confis emitted.
Timer-driven theme tools (eye-comfort, custom oneshots) must obey both unit-order rules below and Omarchy path safety above.
Adopt / keep in sync
arch-machine: keep skill in-tree under .agents/skills/session-unit-order/.
# Publish/sync → skills library (project-born dual-copy procedure)
# follow dual-copy-skill-publish (SoT project → library; hash/diff verify; push=HITL)
# Omarchy skill (host install — separate)
# ~/.agents/skills/omarchy → ~/.local/share/omarchy/default/omarchy-skillForbidden patterns (refuse or rewrite)
Do not add these on timer-driven oneshots (or any unit that can start before a compositor under loginctl Linger):
# FORBIDDEN — activates graphical-session without a compositor
Wants=graphical-session.target
Requires=graphical-session.target
BindsTo=graphical-session.targetSame rule for compositor-specific pulls that mark the session “taken” before UWSM starts, e.g. blindly Wants=/Requires= on wayland-session@*.target / wayland-wm@*.service from a Persistent timer catch-up path.
Safe default for theme / session-adjacent oneshots
[Unit]
Description=Apply theme (example)
After=graphical-session.target
# After= only orders when both are started. It does NOT pull the target.
Conflicts=peer-theme.service
[Service]
Type=oneshot
Environment=OMARCHY_PATH=%h/.local/share/omarchy
# Optional: skip when no compositor socket yet
# ConditionPathExistsGlob=%t/wayland-*
ExecStartPre=-/bin/sh -c 'systemctl --user import-environment WAYLAND_DISPLAY HYPRLAND_INSTANCE_SIGNATURE DISPLAY DBUS_SESSION_BUS_ADDRESS 2>/dev/null || true'
ExecStart=%h/.local/bin/your-theme-tool| Directive | Safe for early timer fire? | Notes |
After=graphical-session.target | Yes | Ordering only |
Wants= / Requires= / BindsTo= graphical-session | No | Pulls empty session; UWSM aborts |
WantedBy=graphical-session.target on a long-running app | Usually OK | Starts with session once compositor is real |
WantedBy=timers.target + Persistent=true | OK only if service does not pull session targets | Catch-up under Linger is the footgun |
ConditionPathExistsGlob=%t/wayland-* | Yes | Soft-skip pre-compositor runs |
Environment=OMARCHY_PATH=… on Omarchy | Yes | Required for template/theme-set path |
Mandatory checklist (before commit)
- Omarchy? If yes → load omarchy skill; refuse edits under
~/.local/share/omarchy/. - List units touched under
~/.config/systemd/user/,modules/**/units/, or install paths that copy them. - Scan for pulls:
Zero hits required on timer-fired oneshots.rg -n '^(Wants|Requires|BindsTo)=.*graphical-session' \ modules/productivity/eye-comfort/units \ "${XDG_CONFIG_HOME:-$HOME/.config}/systemd/user" \ "$@" - Run closed-loop unit tests when eye-comfort units change (in arch-machine):
Must passpython3 modules/productivity/eye-comfort/lib/test_timer_mutex.pytest_services_do_not_pull_graphical_session. - Run skill audit script:
session-unit-order/scripts/audit-session-units.sh # optional: ARCH_MACHINE_ROOT=/path/to/arch-machine # optional: extra unit dirs as args - Linger awareness: if
loginctl show-user "$USER" -p Lingerisyes, assume user timers can run before SDDM/UWSM. - Do not use hard-reboot loops as proof; use journal recipe + unit tests.
Diagnose live failures
journalctl -b -1 --no-pager | rg -i \
'uwsm|graphical-session|eye-comfort|sddm-helper exited|already active'
# Omarchy hosts — extra context (non-interactive)
command -v omarchy >/dev/null && omarchy debug --no-sudo --print 2>/dev/null | head -80| Observation | Meaning |
Reached target Current graphical user session before uwsm / Hyprland | Something pulled the target early |
A compositor or graphical-session* target is already active! | UWSM race — classic failure mode |
sddm-helper exited with 1 right after | Session aborted; first-boot fail |
Success: graphical-session target only after UWSM starts the compositor envelope.
Intelligence rules (do not rationalize around)
- “I need Wants= so the service waits for the session” → false.
After=does not wait if the target is never pulled; use a path condition or a real compositor unit UWSM owns. - “It only runs After=graphical-session so Wants= is fine” → false.
Wants=still starts the target. - “Second boot works so it’s firmware” → false for this fingerprint; Persistent catch-up explains second-boot success.
- Theme color / palette changes do not require session-target pulls.
- “I’ll patch omarchy-theme-set under
~/.local/share/omarchy” → false on Omarchy; use hooks + user themes (omarchy skill).
Related footguns
- Dual timers both touching the same Omarchy theme swap path (
~/.config/omarchy/current/theme) → useConflicts=. systemctl --user daemon-reloadafter unit edits.- System-level power/suspend units are a different domain; this skill is user session order with UWSM/Hyprland.
- Omarchy
refresh/reinstall— seek user confirmation (omarchy skill); out of scope for silent agent runs.
When to load this skill
Auto-invoke on: user systemd unit edits, eye-comfort units/*, install.sh --with-*-timer, UWSM/Hyprland session bugs, Omarchy theme timers/hooks that touch systemd, “first boot fails second works”, graphical-session.target in unit files, blank Wayland after autologin.
With Omarchy: also load omarchy whenever the change touches desktop config, themes, waybar, hypr, or omarchy CLI workflows.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

