#16154

End the input-device watch and pactl subscribe with the shell

Openmrjamesmyerswants to merge intofrom

Problem

Quickshell does not take its Process children along when it stops. PluginRegistry.qml documents this and reaps its own watcher at the next start (#15299); plugins/clipboard/Clipboard.qml:293,302 starts its wl-paste --watch children under setpriv --pdeathsig TERM. Two other long-running children of the shell have neither:

  • shell/Commons/InputDevices.qml:39-45: inotifywait -m on /dev/input, /dev and the udev data dir. On a quiet system it has no event to fail a write on, so after a shell restart or crash the old one stays under init until logout. test/shell.d/input-devices-test.sh already notes that Quickshell "leaves one running when it is stopped itself".
  • shell/Commons/UntypedInput.qml:130: pactl subscribe. It ends at the next audio event (SIGPIPE), so it is brief, but it is a second long-lived child with no owner.

The same leak showed up as 63 and 1002 orphaned watchers in #7150 for the plugin directory watcher. #11385 (open) is a pdeathsig PR for that watcher only.

Change

Prefix both commands with setpriv --pdeathsig TERM, exactly as Clipboard.qml does. setpriv execs the program, so the pid Quickshell sees is unchanged, and the deathsig survives the exec inotifywait inside the bash wrapper. No other behavior changes.

Not run: the QML was not started (no Linux box was used for this check). Runtime check: quickshell kill -p /usr/share/omarchy/shell, then pgrep -a inotifywait should show none with the /dev/input argument.

Found while testing Omarchy 4.5.0-rc1.

Activity

2
greptile-apps[bot]11h ago

Confidence Score: 5/5

[Low impact] The PR appears safe to merge.

Summary

Both long-running watchers now use setpriv --pdeathsig TERM so they stop when Quickshell exits.

  • The input watcher and audio listener stop with Quickshell.

Reviews (1) · Last reviewed commit: "End the input-device watch and pactl sub..." · Reviewed by Greptile