iye/lightsOn

Maybe $delay_progs should be more strict?

Opened this issue · 0 comments

Currently, it matching program by whole 'command line', except by just 'process name'.
So for example:

I have some program named bar in $delay_progs. This program is not running currently. I decided to open file with name 'foobar.sh' in vim:

ps ax | grep bar                                                    
 5678 pts/5    S+     0:00 vi foobar.sh
 5744 pts/1    S+     0:00 grep bar

And here is problem: lightsOn.sh would think that bar program running. But it's not, there are just something, that have string 'bar' in it's arguments.
Delaying the screensaver because a program on the delay list, "bar", is running...

Possible solutions:

  • Don't match $delay_progs by whole 'command line' (remove -f option in pgrep)
  • Do exact match for $delay_progs (add -x option to pgrep)

Also, if legacy is an issue, then this behavior may be implemented as optional.