Fix every app launch failing with "Invalid arguments:" after weeks of uptime
Issue #13287 and its comments support the cause: per-instance dirs never pruned, Bluetooth RSSI and Dropbox dbusmenu spam, 300 MB and 1.5 GB logs, the Hyprland SIGBUS in the screencopy path on Print, the Invalid arguments: toast, and the app_daemon_error flag recovery. On this 4.0.4-1 workstation I dry-ran the record's /proc fd detection read-only: pgrep -x 'quickshell|qs' found the omarchy shell (3148228) and two flea qs instances, KEEP held their three by-id dirs including s6hv1k1crlt (165 MB, ipc.sock), and DELETE listed seven dead dirs. Nothing was deleted. One claim in the fix is wrong. It says the live Omarchy shell can be missing from by-pid/ on 4.0.4-1, but by-pid/3148228 -> by-id/s6hv1k1crlt exists here, dated Sep 22, before the earlier audit. The real reason by-pid is unreliable is that it keeps links for exited processes: 2426, 1956682 and 3130909 have links and no process. Rewrote that sentence. The danger text already says by-pid is unreliable without the false reason, so it stays. Checked systemd.service: $VAR without braces is substituted only as a whole word, so the single-quoted bash -c script in the timer reaches bash intact. The timer was not installed here.
Deleting the running shell's directory under $XDG_RUNTIME_DIR/quickshell/by-id/ removes its ipc.sock and instance.lock. Every omarchy-shell IPC call (menus, bar commands, the lock screen) then fails until the shell restarts, and omarchy-restart-shell re-locks a session whose locker has died. Only delete directories that no running quickshell or qs process has open, and run the dry run first. by-pid/ is not a reliable record of which instances are live.
Symptom
After a couple of weeks without a reboot, nothing launches. Super+Enter and every launcher entry show a toast that says only Invalid arguments: . systemd-run --user --scope true fails with Failed to start transient scope unit. On some machines pressing Print crashes Hyprland into its recovery screen instead (SIGBUS in the screencopy path). df -h /run/user/$UID shows 100%.
Cause
The Omarchy shell (Quickshell) writes a log directory per instance under $XDG_RUNTIME_DIR/quickshell/by-id/, a size-limited tmpfs, and never prunes it. Every shell restart or crash leaves another directory. The live instance's log.qslog also grows without limit when a chatty source is present: Bluetooth RSSI updates for nearby devices, or a tray item such as Dropbox re-sending its dbusmenu every few seconds. Reports show 300 MB to 1.5 GB in a week. When the tmpfs is full, the systemd user manager cannot create the transient scopes uwsm-app launches into, and wayland-wm-app-daemon can latch an error flag that keeps it refusing requests even after space is freed. On the workstation this was written on, one live instance had a 147 MB log after 12 days.
Fix
See what is using the space:
df -h "$XDG_RUNTIME_DIR"
du -sh "$XDG_RUNTIME_DIR"/quickshell/by-id/* | sort -h | tail
Find the instance directories that running shells actually have open. Do not trust by-pid/: it keeps a link for every instance ever started, including ones whose process has exited and whose PID may since belong to another program. Match qs as well as quickshell, because other apps run their own Quickshell instances. Dry run first. This deletes nothing:
qs="$XDG_RUNTIME_DIR/quickshell"
live=$(for p in $(pgrep -x 'quickshell|qs'); do
find /proc/$p/fd -maxdepth 1 -lname "$qs/by-id/*" -printf '%l\n' 2>/dev/null
done | sed -E "s#^($qs/by-id/[^/]+)/.*#\1#" | sort -u)
echo "KEEP:"; echo "$live"
echo "DELETE:"; for d in "$qs"/by-id/*; do grep -qxF "$d" <<<"$live" || echo "$d"; done
Check that KEEP holds at least one directory and that the directory with ipc.sock and the big log.qslog is in it. Then delete the rest:
if [[ -n $live ]]; then
for d in "$qs"/by-id/*; do grep -qxF "$d" <<<"$live" || rm -rf -- "$d"; done
find "$qs/by-pid" "$qs/by-shell" -xtype l -delete
else
echo "no running Quickshell instance found, nothing deleted"
fi
df -h "$XDG_RUNTIME_DIR"
If the live shell's own log is the big one, restart the shell or reboot to start it from zero. truncate -s 0 <dir>/log.qslog on the open file is a stopgap a commenter uses. It is likely to free the space, but its effect on a file Quickshell holds open is not confirmed. Do not restart the shell from ssh or a locked session, because omarchy-restart-shell re-locks a session whose locker has died.
If launches still fail after space is freed, clear the app daemon's error flag:
rm -f "$XDG_RUNTIME_DIR/uwsm/app_daemon_error"
systemctl --user restart wayland-wm-app-daemon.service
To stop it recurring, add an hourly user timer that trims any instance log over 100 MB. It only truncates files and never deletes directories:
mkdir -p ~/.config/systemd/user
cat > ~/.config/systemd/user/quickshell-log-trim.service <<'EOF'
[Unit]
Description=Trim oversized Quickshell instance logs
[Service]
Type=oneshot
ExecStart=/bin/bash -c 'for f in "$XDG_RUNTIME_DIR"/quickshell/by-id/*/log.qslog "$XDG_RUNTIME_DIR"/quickshell/by-id/*/log.log; do [ -f "$f" ] && [ "$(du -k "$f" | cut -f1)" -gt 102400 ] && truncate -s 0 "$f"; done; true'
EOF
cat > ~/.config/systemd/user/quickshell-log-trim.timer <<'EOF'
[Unit]
Description=Hourly Quickshell log trim
[Timer]
OnCalendar=hourly
Persistent=true
[Install]
WantedBy=timers.target
EOF
systemctl --user daemon-reload
systemctl --user enable --now quickshell-log-trim.timer
Verify
df -h "$XDG_RUNTIME_DIR"
ls "$XDG_RUNTIME_DIR"/quickshell/by-id | wc -l
systemctl --user list-timers quickshell-log-trim.timer
Usage is low, one instance directory remains, and Super+Enter opens a terminal.