Replace pidof usage with pgrep
The patch changes the logic to use pgrep, now included as a standard tool in most BSD and linux systems, in place of using pidof.
The change also simplifies logic a little.
I have performed some testing using the "switch user" functionality in the screensaver and everything works as expected.
This has been requested by a FreeBSD user [1]
[1] https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=290766
Fixes: #38 (closed)
Edited by Gaël Bonithon