omarchy-voxtype-status script orphans child processes due to missing SIGTERM trap
System details
AMD 9850, Nvidia RTX 5080
What's wrong?
Bug Report: omarchy-voxtype-status Orphans Child Processes on Waybar Reloads
Description
The omarchy-voxtype-status script fails to clean up its child processes when terminated by a system signal, such as when Waybar reloads. This causes orphaned voxtype status --follow processes to accumulate in the background over time, unnecessarily cluttering the process tree and consuming system resources.
Root Cause
The script uses a trap to kill its child processes when it exits:
# File: ~/.local/share/omarchy/bin/omarchy-voxtype-status (Line 5)
trap 'kill 0' EXIT
However, in Bash, trapping EXIT only executes the cleanup command during a normal script termination. When Waybar reloads (or when the process is killed externally), it sends a SIGTERM signal to the script. Because the script does not explicitly trap SIGTERM, Bash terminates immediately without executing the kill 0 trap. This leaves the voxtype status --follow command running endlessly in the background.
Steps to Reproduce
- Start Waybar with the
voxtypemodule enabled. - Trigger a Waybar reload (e.g., via
omarchy restart waybaror saving a Waybar config file). - Run
pgrep -a -f "voxtype status"and observe that the oldvoxtype status --followprocesses are still running. - Repeat the reload multiple times to see the processes multiply.
Proposed Fix
Update the trap command to explicitly catch termination and interrupt signals in addition to EXIT.
Modify line 5 in omarchy-voxtype-status from:
trap 'kill 0' EXIT
to:
trap 'kill 0' EXIT SIGTERM SIGINT
This ensures the trap fires correctly regardless of how the script is stopped, properly terminating the child voxtype polling process.
This is fixed for the next release 👍