Add systemd user service as a desktop-agnostic autostart option - #10
Open
MHS-20 wants to merge 1 commit into
Open
Add systemd user service as a desktop-agnostic autostart option#10MHS-20 wants to merge 1 commit into
MHS-20 wants to merge 1 commit into
Conversation
MHS-20
force-pushed
the
add-systemd-autostart
branch
from
September 6, 2026 19:47
670252a to
174091d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #9
Summary
systemd/vrgb-restore.service, a systemd--userunit that runsvrgb restoreat the start of the graphical session (After=graphical-session.target,WantedBy=graphical-session.target).install.shnow offers this as a second, independent autostart prompt after the existing KDE one — both can be enabled together, they do the same thing and don't conflict.uninstall.shremoves it if present (systemctl --user disable --now+ delete the unit +daemon-reload), and its step numbering ([N/4]→[N/5]) was updated to account for the new step.Featuresand an update to theUninstall→Removes:list.Why
The existing autostart option only covers the XDG autostart spec (
~/.config/autostart/vrgb.desktop), which not every desktop environment processes — tiling Wayland compositors like Hyprland or Sway start applications explicitly rather than scanning~/.config/autostart/. On those setups the saved state silently never gets restored after a reboot, even though the installer's autostart prompt was accepted. See #9 for the full writeup and the environment where this was hit.A systemd
--userunit sidesteps this entirely since it's handled by the systemd user session itself, independent of which compositor/WM is running.Design notes
vrgb restoreon login), not a general-purpose daemon. Keeps this PR orthogonal to the separatevrgb cyclePR (Add vrgb cycle command for software rainbow cycling #8); either can land independently of the other.Type=oneshot(not a long-running service) sincevrgb restoreis a single command that exits — matches what the unit actually does and avoids systemd treating a normal exit as a failure.enable: at install time the user's own group membership for thevrgbudev rule hasn't taken effect yet (documented elsewhere in the installer as needing a re-login), so starting it immediately would just fail with a permission error. It activates cleanly from the next login onward instead.System tested on
ITE5570:00 0B05:19B6,HID_ID=0018:00000B05:000019B6x86_64,#1 SMP PREEMPT_DYNAMIC)4.0.0.r2015.g4930677--usersession management (uwsm) — the exact case Autostart restore only supports KDE (XDG autostart); doesn't work on Hyprland/Sway/etc #9 describes as broken with XDG-autostart-only toolingsystemctl --user) as shipped with this Omarchy releaseTesting performed
bash -n install.sh/bash -n uninstall.sh— both parse cleanly.shellcheck install.sh uninstall.sh— no new warnings introduced. The one pre-existing informational warning (SC2162,readwithout-r) is on the KDE prompt line I followed the same pattern from, not something introduced by this PR; left as-is for consistency with the surrounding code rather than fixing unrelated code in this PR.systemd-analyze verifyonsystemd/vrgb-restore.service— exits 0, no unit-file errors.~/.config/systemd/user/, ransystemctl daemon-reload+systemctl --user enable, confirmed systemd recognized and could manage the unit (this mirrors exactly whatinstall.sh's new prompt does, run manually to avoid re-running the full interactive/sudo installer against a live system that already hadvrgbinstalled).systemctl --user disable --now ... || truewon't abort the script underset -eif the unit was never enabled.Not tested: the actual "survives a real reboot and restores state" end-to-end path for this specific unit, since my daily-use autostart on this machine is currently handled by a separate
--now-enabled unit for continuous color cycling (see #8) rather than a one-shot restore. The unit itself is the same pattern already proven to work for that other, more demanding use case (a long-runningRestart=alwaysservice using the identicalgraphical-session.targethook), so I'm confident in the mechanism, but wanted to flag exactly what was and wasn't exercised.