4

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.

Sylvain Pineau
  • 61,564
  • 18
  • 149
  • 183
Eamonn Doyle
  • 1,178
  • 4
  • 12
  • 20

2 Answers2

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.

3

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

Sylvain Pineau
  • 61,564
  • 18
  • 149
  • 183
  • 1
    How do you guys get the indicator to show numbers? Mine just shows graphs. I'd like to have a text label or mouseover on the graph. (15.04) – Jean Jordaan Jul 11 '15 at 16:11
  • you could also add a unicode "WIDE SPACE" to the front, not sure how to actually do it tho – user230910 Jul 23 '17 at 12:13
  • didnt work in 16.04. compiled without errors, but failed on execution. – kmace Sep 25 '17 at 21:53
  • 1
    "failed on execution", if you mean that indicator items don't show up, same results for me. I went back to [0.4](https://launchpad.net/indicator-multiload/stable/0.4/+download/indicator-multiload-0.4.tar.gz) (because seems like indicators were [removed](http://bazaar.launchpad.net/~indicator-multiload/indicator-multiload/trunk/revision/137) since). I applied the described fix against that, it works. Requires [this (#138) code fix](http://bazaar.launchpad.net/~indicator-multiload/indicator-multiload/trunk/revision/138) (puzzles me how 0.4 was successfully released with that). I'm on 16.04. – Sander Verhagen Jan 02 '18 at 09:46