Skip to main content

max / alloy

swayosd: put the libinput unit where systemd looks The caps-lock and num-lock overlays have never worked. Fedora's SwayOSD-0.3.2 installs swayosd-libinput-backend.service into /usr/lib64/systemd/system/, systemd searches /usr/lib/systemd/system, and on Fedora /usr/lib64 is a real directory rather than a symlink. So the unit was invisible, and the preset line added on 2026-07-21 to enable it matched nothing and was ignored without a word. That is the same silent no-op this project already documented for template units in 50-alloy.preset, reached by a different route: a preset line naming a unit systemd cannot see reads exactly like the feature being broken. Copied rather than symlinked, so it survives the package moving the file. Both directions asserted first: if the unit leaves /usr/lib64, or if it starts arriving in /usr/lib, the build fails and says to drop the workaround, rather than silently installing a stale duplicate. Verified in the image: systemd-analyze verify resolves the unit only after the copy, and default.target is graphical.target, so the unit's WantedBy actually activates.
Co-Authored-By
Claude Opus 5 (1M context) <noreply@anthropic.com>
Author: Max Johnson <me@maxj.phd> · 2026-07-25 18:54 UTC
Signed with PGP, not checked
Commit: d15147ec0d6e241570e433b2dd48030556cf5bea
Parent: 68fe10f
1 file changed, +26 insertions, -0 deletions
@@ -393,6 +393,32 @@
393 393 jq \
394 394 && dnf clean all
395 395
396 + # SwayOSD ships its system unit where systemd does not look.
397 + #
398 + # Fedora's SwayOSD-0.3.2 installs swayosd-libinput-backend.service into
399 + # /usr/lib64/systemd/system/. systemd's system unit search path is
400 + # /usr/local/lib/systemd/system and /usr/lib/systemd/system, and on Fedora
401 + # /usr/lib64 is a real directory rather than a symlink to /usr/lib, so the unit
402 + # is invisible. `enable swayosd-libinput-backend.service` in
403 + # etc/systemd/system-preset/50-alloy.preset therefore matched nothing and was
404 + # ignored without a word — the same silent-no-op this project already documented
405 + # for template units, arrived at by a different route.
406 + #
407 + # The visible symptom is the one the preset was added to fix on 2026-07-21: the
408 + # sway config's `bindsym --release Caps_Lock` and Num_Lock overlays have nothing
409 + # running behind them, because the libinput backend that watches modifier state
410 + # is a system service and never started.
411 + #
412 + # Copied rather than symlinked so the unit survives the package moving it, and
413 + # asserted first so that the day Fedora fixes the packaging this build fails
414 + # loudly instead of silently installing a stale duplicate.
415 + RUN test -f /usr/lib64/systemd/system/swayosd-libinput-backend.service \
416 + || { echo "SwayOSD unit is no longer in /usr/lib64 — drop this workaround"; exit 1; } \
417 + && test ! -f /usr/lib/systemd/system/swayosd-libinput-backend.service \
418 + || { echo "SwayOSD now ships the unit correctly — drop this workaround"; exit 1; } \
419 + && cp /usr/lib64/systemd/system/swayosd-libinput-backend.service \
420 + /usr/lib/systemd/system/swayosd-libinput-backend.service
421 +
396 422 # distrobox is pinned. v2 is a Go rewrite, at rc.3 as of 2026-06-29, and
397 423 # upstream's own announcement says v1 stays the production recommendation
398 424 # and that exported binaries and apps must be re-exported after