Results 1 to 4 of 4

Thread: launch application in KDE with priority (nice) set

  1. #1

    Default launch application in KDE with priority (nice) set

    Hello,
    is there a way, in KDE (4.8.5) to add a command 'switch' to the execution command for an application that will set the process priority or 'nice' each time it's started. This does Not need to be 'firefox' specific. General app launch will help.

    exp. I run mozilla Firefox, Aurora nightly and some nightly builds suck up the memory / cpu and I have to Ctrl+Esc and set (process) priority (renice) firefox.
    I would like to add something to the KDE 'launch' command (kicker icon for firefox Aurora) like: [~/bin/mozilla/Aurora/firefox %u -P] -n -2 nice , but when I try this, firefox loads 'nice' as a url...

    I could use this for other applications like Gimp, but I can't figure out the right switch syntax ..

    Any ideas, please?

    Thank you in advance.
    Reed.

  2. #2
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,270

    Default Re: launch application in KDE with priority (nice) set

    You should read the man page of the nice command (and maybe generaly about shell commands). It is not
    Code:
    [~/bin/mozilla/Aurora/firefox %u -P] -n -2 nice
    but
    Code:
    nice -n -2 ~/bin/mozilla/Aurora/firefox %u -P
    (if that -P is in the correct place???)
    Henk van Velden

  3. #3
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,270

    Default Re: launch application in KDE with priority (nice) set

    I can answer my last question:
    (if that -P is in the correct place???)

    No it isn't either. Look here:
    Code:
     firefox -h
    Usage: /usr/lib64/firefox/firefox [ options ... ] [URL]
           where options include:
    
    X11 options
      --display=DISPLAY  X display to use
      --sync             Make X calls synchronous
      --g-fatal-warnings Make all warnings fatal
    
    Firefox options
      -h or -help        Print this message.
      -v or -version     Print Firefox version.
      -P <profile>       Start with <profile>.
      -migration         Start with migration wizard.
      -ProfileManager    Start with ProfileManager.
      -no-remote         Do not accept or send remote commands; implies -new-instance.
      -new-instance      Open new instance, not a new window in running instance.
      -UILocale <locale> Start with <locale> resources as UI Locale.
      -safe-mode         Disables extensions and themes for this session.
      -jsconsole         Open the Error console.
      -browser           Open a browser window.
      -new-window  <url> Open <url> in a new window.
      -new-tab     <url> Open <url> in a new tab.
      -preferences       Open Preferences dialog.
      -search     <term> Search <term> with your default search engine.
      -private           Enable private browsing mode.
      -private-toggle    Toggle private browsing mode.
      -setDefaultBrowser Set this app as the default browser.
    henk@boven:~>
    Which shows that options come before the URL and also that the -P option must be followed by a <profile> (whatever that is).
    Thus
    Code:
    firefox -P <profile> %u
    is the correct way to call Firefox if you want to offer it a profile.
    Henk van Velden

  4. #4
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    11,394
    Blog Entries
    2

    Default Re: launch application in KDE with priority (nice) set

    Just another thought...
    If this is something you run regularly and want to automate it, you might try creating a systemd Unit service that invokes your Firefox (or maybe GUI-less web transfer?). In the Unit configuration file, it's trivial to set the priority to whatever you wish.

    TSU

Tags for this Thread

Posting Permissions

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