File tree Expand file tree Collapse file tree 1 file changed +9
-32
lines changed Expand file tree Collapse file tree 1 file changed +9
-32
lines changed Original file line number Diff line number Diff line change 40
40
41
41
stumpwm_pid ()
42
42
{
43
- local pid=$$
44
-
45
- while :
46
- do
47
- if [ $pid -eq 1 ]
48
- then
49
- echo " StumpWM not found in the process tree, are you sure a graphical " 1>&2
50
- echo " session is running and StumpWM is your WM? If you think this is " 1>&2
51
- echo " a bug in stumpish, please report it." 1>&2
52
- echo 1>&2
53
- exit 1
54
- elif [ -e " /proc/${pid} /comm" -a " $( cat /proc/${pid} /comm 2> /dev/null) " = " stumpwm" ]
55
- then
56
- STUMPWM_PID=$pid
57
- break
58
- elif [ -n " $( which pgrep 2> /dev/null) " ]
59
- then
60
- pid=$( pgrep stumpwm)
61
- if [ -n $pid ]
62
- then
63
- STUMPWM_PID=$pid
64
- break
65
- else
66
- pid=1
67
- fi
68
- elif [ -e /proc/$pid /stat ]
69
- then
70
- pid=$( cut -f 4 -d " " < /proc/$pid /stat)
71
- else
72
- pid=1
73
- fi
74
- done
43
+ STUMPWM_PID=$( pgrep stumpwm)
44
+
45
+ if [ -z " $STUMPWM_PID " ]; then
46
+ echo " StumpWM not found in the process tree, are you sure a graphical " 1>&2
47
+ echo " session is running and StumpWM is your WM? If you think this is " 1>&2
48
+ echo " a bug in stumpish, please report it." 1>&2
49
+ echo 1>&2
50
+ exit 1
51
+ fi
75
52
}
76
53
77
54
wait_result ()
You can’t perform that action at this time.
0 commit comments