shawnrice / alfred-2-caffeinate-workflow

An Alfred2 workflow to control the system caffeinate utility (prevents sleep).
MIT License
172 stars 8 forks source link

False positives when searching for caffeinate process #11

Closed andreiborisov closed 6 years ago

andreiborisov commented 6 years ago

When invoking workflow search command

ps -eo etime,args|grep -w caffeinate|grep -v grep|sed -e 's|^[[:space:]]*||'

on my system, I get following results:

16:39 /bin/bash /Users/schrodinger_cat/Library/Scripts/com.plexapp.plexmediaserver.caffeinate.sh 05:41 /Applications/Alfred 3.app/Contents/Preferences/Alfred Preferences.app/Contents/MacOS/Alfred Preferences /Users/schrodinger_cat/Downloads/caffeinate_control.alfredworkflow 00:07 caffeinate -s -t 300

The problem is, this gives false positive results when searching, therefore workflow is always showing that caffeinate is activated and prevents enabling of caffeinate command.

shawnrice commented 6 years ago

Good catch, and thanks for the PR. Merged.