Glam Prestige Journal

Bright entertainment trends with youth appeal.

I'm getting a bit seasick with the indicator-mulitload as it constantly cycles between cpu usage less than 10% and greater than 10% which means all the other icons in the tray get pushed back and forth as cpu usage drops in and out of greater or less than 10%.

Is there any way to force the cpu usage to be displayed at at least 2 digits, so 8% would be 08%, as this would stop the icons moving, unless of course it hits 100% but that's so rare I'm not not bothered about taking up the extra space to cover that rarity. I'm happy for it to move everything on that occasion and my guess I'll have more problems anyway if it does as the system will likely keep freezing until cpu cycles drop off again.

2 Answers

There's no way to specify the printf format unfortunately. To always have two digits displayed for CPU usage you need to compile indicator-multiload from source.

  1. install the build dependencies:

    sudo apt-get install bzr
    sudo apt-get build-dep indicator-multiload
  2. branch the project sources:

    bzr branch lp:indicator-multiload
  3. Fix the print format for percent data:

    cd indicator-multiload
    sed -i 's/%u%%/%02u%%/' src/function.vala
  4. Build it:

    ./autogen.sh && make indicator-multiload
  5. Install the patched indicator in /usr/local/bin:

    sudo cp indicator-multiload /usr/local/bin

Now below 10%, CPU usage is displayed like this:

enter image description here

4

If you don't mind the percentage notation, it's possible to format it to always use 2 decimals places within a [0-1] range:

CPU $(decimals(cpu.inuse,2))

See this answer explaining where to use this configuration.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy