mirror of
https://github.com/stumpwm/stumpwm-contrib.git
synced 2026-09-10 07:26:25 -04:00
stumpish: Fix search for stumpwm PID if launched as stumpwm child process.
FreeBSD specific fix. In the FreeBSD the pgrep didn't list processes, which are ancestors of pgrep even if they are matched with given string. So, if stumpish was launched from the stumpwm itself, then it couldn't find PID of stumpwm process. This fix uses pgrep with '-a' key, which enable showing even the ancestors of pgrep in the it's output.
This commit is contained in:
parent
1e3fa7abae
commit
495d6e941e
|
|
@ -40,7 +40,9 @@ fi
|
|||
|
||||
stumpwm_pid ()
|
||||
{
|
||||
if command -v pgrep 2>&1 >/dev/null; then
|
||||
if test $(uname -s) = "FreeBSD" && command -v pgrep 2>&1 > /dev/null; then
|
||||
STUMPWM_PID=$(pgrep -a -u $(id -u) stumpwm)
|
||||
elif command -v pgrep 2>&1 >/dev/null; then
|
||||
STUMPWM_PID=$(pgrep -u $(id -u) stumpwm)
|
||||
elif [ -d /proc ]; then
|
||||
# Go up the process chain until we locate StumpWM's process using
|
||||
|
|
|
|||
Loading…
Reference in a new issue