Index: panel-plugin/mailwatch-plugin.c =================================================================== --- panel-plugin/mailwatch-plugin.c (revision 6773) +++ panel-plugin/mailwatch-plugin.c (working copy) @@ -187,7 +187,34 @@ switch(evt->button) { case 1: /* left */ if(mwp->click_command && *mwp->click_command) - xfce_exec(mwp->click_command, FALSE, FALSE, NULL); + { + // expand any recognized formatting sequences in command + char buf[256]; + char *p = mwp->click_command; + int i = 0; + + while (*p && i < (sizeof buf)-1) + { + if (*p != '%') + buf[i++] = *p++; + else + { + ++p; + switch (*p) + { + case 'P': + ++p; + i += snprintf(buf+i,((sizeof buf)-1)-i,"%u",getpid()); + break; + + default: + break; + } + } + } + buf[i] = 0; + xfce_exec(buf, FALSE, FALSE, NULL); + } break; case 2: /* middle */