1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-11-17 18:45:10 +00:00

argument of $cmdline_to_pid doesnt have to be the full commandline

This commit is contained in:
Nikolas Garofil 2009-11-15 00:51:38 +01:00
parent 7b6e01b869
commit 038e182c38
2 changed files with 4 additions and 3 deletions

View File

@ -538,9 +538,10 @@
<command> <command>
<option>cmdline_to_pid</option> <option>cmdline_to_pid</option>
</command> </command>
<option>pid</option> <option>string</option>
</term> </term>
<listitem>PID of process invoked with this command line <listitem>PID of the first process that has string in it's
commandline
<para /></listitem> <para /></listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>

View File

@ -342,7 +342,7 @@ void print_cmdline_to_pid(struct text_object *obj, char *p, int p_max_size) {
for(i = 0; i < bytes_read - 1; i++) { for(i = 0; i < bytes_read - 1; i++) {
if(buf[i] == 0) buf[i] = ' '; if(buf[i] == 0) buf[i] = ' ';
} }
if(strcmp(buf, obj->data.s) == 0) { if(strstr(buf, obj->data.s) != NULL) {
snprintf(p, p_max_size, "%s", entry->d_name); snprintf(p, p_max_size, "%s", entry->d_name);
free(buf); free(buf);
closedir(dir); closedir(dir);