Page 3 of 3 FirstFirst 123
Results 21 to 28 of 28

Thread: How-to: Screen saver inhibitor for Firefox flash player container-plugin or whatever...

  1. #21

    Default Re: How-to: Screen saver inhibitor for Firefox flash player container-plugin or whatever...

    Sorry, it's way out of my league, but the command:

    Code:
    ps x |grep -v grep |grep -c "plugin-containe"
    returns: 0 or 1, isn’t that enough?

  2. #22
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: How-to: Screen saver inhibitor for Firefox flash player container-pluginor whatever...

    On 2015-07-07 20:06, noital wrote:

    > returns: 0 or 1, isn’t that enough?


    Yes, of course, I know it works. I just want to do it the other way. Or
    let's say that I want to learn about that trick with 'ps'. ;-)

    --
    Cheers / Saludos,

    Carlos E. R.

    (from 13.1 x86_64 "Bottle" (Minas Tirith))

  3. #23

    Default Re: How-to: Screen saver inhibitor for Firefox flash player container-pluginor whatever...

    Quote Originally Posted by robin_listas View Post
    But I have problems getting both options to work in a single command line.
    You mean something like:
    Code:
    ps -C syslogd -o pid=
    That's taken verbatim from the man page, if you want the PIDs of all "plugin-container" processes, it would be:
    Code:
    ps -C plugin-container -o pid=
    (you can specify the column header after the '=', in this case it's empty)

    Or to go with the format you posted in a previous post:
    Code:
    ps -C konqueror -o pcpu,user,fname,comm
    Last edited by wolfi323; 08-Jul-2015 at 04:44.

  4. #24
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: How-to: Screen saver inhibitor for Firefox flash player container-pluginor whatever...

    On 2015-07-08 13:46, wolfi323 wrote:
    >
    > robin_listas;2718651 Wrote:
    >> But I have problems getting both options to work in a single command
    >> line.
    >>

    > You mean something like:
    >
    > Code:
    > --------------------
    > ps -C syslogd -o pid=
    > --------------------


    This one is perfect!

    Code:
    cer@minas-tirith:~> ps -C rsyslogd -o pcpu=
    0.0
    cer@minas-tirith:~>
    Thanks!


    > Or to go with the format you posted in a previous post:
    >
    > Code:
    > --------------------
    > ps -C konqueror -o pcpu,user,fname,comm
    > --------------------


    I was trying:

    Code:
    ps -C plugin-containe -xo pcpu,user,fname,comm
    but got a syntax error. It doesn't like the '-x'. However, your
    concoction is much better, it produces a single word with the value that
    is needed, without any need for parsing the text. It should work nicely.
    I'll have a go at it tonight, I hope.

    --
    Cheers / Saludos,

    Carlos E. R.

    (from 13.1 x86_64 "Bottle" (Minas Tirith))

  5. #25

    Default Re: How-to: Screen saver inhibitor for Firefox flash player container-pluginor whatever...

    Quote Originally Posted by robin_listas View Post
    I was trying:

    Code:
    ps -C plugin-containe -xo pcpu,user,fname,comm
    but got a syntax error. It doesn't like the '-x'.
    Same here.
    Maybe you meant "ps -C plugin-containe x -o pcpu,user,fname,comm"?

    However, your
    concoction is much better, it produces a single word with the value that
    is needed, without any need for parsing the text.
    Actually it produces a line with the value for each process with that name (there might be more than one).

  6. #26
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: How-to: Screen saver inhibitor for Firefox flash player container-pluginor whatever...

    On 2015-07-08 18:46, wolfi323 wrote:

    >> but got a syntax error. It doesn't like the '-x'.

    > Same here.
    > Maybe you meant "ps -C plugin-containe x -o pcpu,user,fname,comm"?


    Mmm?

    No... it prints dozens of lines, none pertaining to "plugin-container".


    >> However, your
    >> concoction is much better, it produces a single word with the value that
    >> is needed, without any need for parsing the text.

    > Actually it produces a line with the value for each process with that
    > name (there might be more than one).


    Ah, lines, true...
    Ok, not a big deal, anyway. I can use that, I think. :-)

    --
    Cheers / Saludos,

    Carlos E. R.

    (from 13.1 x86_64 "Bottle" (Minas Tirith))

  7. #27

    Default Re: How-to: Screen saver inhibitor for Firefox flash player container-pluginor whatever...

    Quote Originally Posted by robin_listas View Post
    On 2015-07-08 18:46, wolfi323 wrote:

    >> but got a syntax error. It doesn't like the '-x'.

    > Same here.
    > Maybe you meant "ps -C plugin-containe x -o pcpu,user,fname,comm"?


    Mmm?

    No... it prints dozens of lines, none pertaining to "plugin-container".
    Yeah, right.
    It prints all user processes.
    The x probably overrides the -C. Without it it works as intended.
    Except that it probably should be "plugin-container", not "plugin-containe". The -C option needs a full match, not just a sub-string.

  8. #28
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: How-to: Screen saver inhibitor for Firefox flash player container-pluginor whatever...

    On 2015-07-08 20:16, wolfi323 wrote:

    > Yeah, right.
    > It prints all user processes.
    > The x probably overrides the -C. Without it it works as intended.


    Can be.

    > Except that it probably should be "plugin-container", not
    > "plugin-containe". The -C option needs a full match, not just a
    > sub-string.


    I still haven't managed to have a go at it today, but when I tried some
    days ago I had to remove the 'r' because the size of the field is
    limited, apparently, and did not match. I have to re-verify this, though.

    --
    Cheers / Saludos,

    Carlos E. R.

    (from 13.1 x86_64 "Bottle" (Minas Tirith))

Page 3 of 3 FirstFirst 123

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •