We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7f0bc88 commit 63b62c6Copy full SHA for 63b62c6
util/stumpish/stumpish
@@ -51,12 +51,25 @@ stumpwm_pid ()
51
echo "a bug in stumpish, please report it." 1>&2
52
echo 1>&2
53
exit 1
54
- elif [ "$(cat /proc/${pid}/comm)" = "stumpwm" ]
+ elif [ -e "/proc/${pid}/comm" -a "$(cat /proc/${pid}/comm 2>/dev/null)" = "stumpwm" ]
55
then
56
STUMPWM_PID=$pid
57
break
58
- else
+ elif [ -n "$(which pgrep 2>/dev/null)" ]
59
+ then
60
+ pid=$(pgrep stumpwm)
61
+ if [ -n $pid ]
62
63
+ STUMPWM_PID=$pid
64
+ break
65
+ else
66
+ pid=1
67
+ fi
68
+ elif [ -e /proc/$pid/stat ]
69
70
pid=$(cut -f 4 -d " " < /proc/$pid/stat)
71
72
73
fi
74
done
75
}
0 commit comments