A couple times a day, my entire screen is filled with xeyes, and I'm trying to figure out a way to have that backfire on the perpetrator.
I've got a snippet of code that, if xeyes exists, will shut it down and send it back to the person that created it. However, my coworkers have gotten smarter and only leave the eyes up a short time so I can't fire off my command in time.
So my problem is this: Is there a daemon/process/something that I can use to execute my "backfire" command?
I've already tried a bash script:
while true ; do
check=`ps aux | grep -c xeyes`
if [ $check -ge 1 ] ; then
However, this noticeably hits the processor on my sys monitor (which matters at work), and I'm looking for a much more efficient way to do this.
Any suggestions from the hive mind?