Arch: sg no longer exists — dictee-ptt.service crash-loops and text injection fails silently
Summary
dictee depends on sg (from shadow) in two places. Arch Linux no longer
ships /usr/bin/sg, so on Arch and derivatives:
dictee-ptt.servicenever starts — it crash-loops on203/EXEC.- Text injection fails silently, because the fallback path pipes into
sgwith stderr discarded.
The result is that push-to-talk never works, and on affected setups dictation appears to do nothing at all.
Environment
- CachyOS (Arch-based), kernel 7.2.6-1-cachyos
- KDE Plasma 6.7.5, Wayland
dictee1.3.6-1shadow4.20.0.arch1-1.1pacman -Qo /usr/bin/sg→error: No package owns /usr/bin/sg
1. dictee-ptt.service crash-loops
/usr/lib/systemd/user/dictee-ptt.service:
ExecStart=/usr/bin/sg input -c "/usr/bin/dictee-ptt"
(sg)[209302]: dictee-ptt.service: Unable to locate executable '/usr/bin/sg': No such file or directory
(sg)[209302]: dictee-ptt.service: Failed at step EXEC spawning /usr/bin/sg: No such file or directory
systemd[2137]: dictee-ptt.service: Main process exited, code=exited, status=203/EXEC
systemd[2137]: dictee-ptt.service: Scheduled restart job, restart counter is at 119.
With Restart=on-failure this loops indefinitely. Nothing surfaces to the user:
the plasmoid still works, so the only symptom is that the hotkey does nothing.
2. safe_dotool() fails silently
/usr/bin/dictee:
if id -nG 2>/dev/null | grep -qw input; then
_DOTOOL_NEEDS_SG=0
else
_DOTOOL_NEEDS_SG=1
fi
safe_dotool() {
if [[ $_DOTOOL_NEEDS_SG -eq 1 ]]; then
{ ...; cat; } | sg input -c 'dotool' 2>/dev/null || true
else
{ ...; cat; } | dotool 2>/dev/null || true
fi
}
The sg branch is taken exactly in the case the comment describes — the user
was added to input by the package's post-install, after the graphical session
had already started, so plasmashell (and anything it spawns) still lacks the
group. On Arch that branch cannot work, and 2>/dev/null || true discards both
the missing-binary error and any dotool error, so transcription succeeds and
the text is simply never typed, with nothing in the logs.
Suggested fix
sg is not portable. Two independent changes:
- Drop
sgfromExecStart. The shipped udev rule already grants theinputgroup access to/dev/uinput, and the package adds the user toinput, so the wrapper is only needed to bridge the window before the user re-logs in. Removing it and documenting "log out and back in after install" is simpler and works everywhere. (SupplementaryGroups=is not available to systemd user units, so it is not an alternative here.) - Do not swallow
dotool's stderr. At minimum route it to the debug log whenDICTEE_DEBUG=true; a silent failure here is very hard to diagnose.
If the sg bridge is worth keeping, gate it on command -v sg and fall back to
calling dotool directly, plus a warning, rather than failing silently.
Workaround for affected users
# ~/.config/systemd/user/dictee-ptt.service.d/override.conf
[Service]
ExecStart=
ExecStart=/usr/bin/dictee-ptt
after confirming id -nG lists input (log out and back in once if it does not).
Thanks for your precise report, good catch. Reproduced on an Arch VM: Arch's shadow 4.20 no longer ships sg, and nothing else provides it.
sg was only there so that the input group works right after install, without logging out. On Arch the newgrp from util-linux can do the same job with -c, so dictee-ptt and dictee now use sg when it exists and newgrp -c otherwise. The unit no longer calls sg at all. Tested on the same VM: push-to-talk starts and types.
This ships in 1.3.7. Until then, your override plus one logout is the right workaround.
1.3.7-rc4 is out as a pre-release. It has the sg/newgrp fix from this issue, the extra-devices change from #36, and the headset and silence threshold changes from #37. On Arch:
curl -fsSL https://github.com/rcspam/dictee/releases/download/v1.3.7-rc4/install.sh | bash -s -- --version 1.3.7-rc4
Your override is no longer needed, systemctl --user revert dictee-ptt removes it. If push-to-talk starts and types without it, that's the confirmation I'm after.
1.3.7 is out as the final release. The code is the same as rc4, only the version number changed. If you already run rc4, you don't need to do anything. Otherwise, to update:
curl -fsSL https://github.com/rcspam/dictee/releases/download/v1.3.7/install.sh | bash
If something still doesn't work for you, tell me here.