Once in a while some program (ok, usually it's firefox) will start eating up nearly 100% of a processor's cpu time, heating up the processor and driving down by laptop's battery life. Since it's not bad enough to impact performance, I usually don't notice for a while, so I'd like to change this:

Is there a utility that monitors process cpu usage and popus up an alert if some process is using a lot of cpu time for an extended period of time (e.g., more than 30 seconds)? I can probably rig something up with ps or top, sed and a bunch of pipes, but I'm hoping there's a more direct way to do it.

Edit: On second thought, what I'm really after is power usage. So any instrumentation specifically targeted at estimating power consumption is of particular interest.

I'm on OS X 10.8, but welcome Linux-specific solutions as well.


1 Answer 1


Rolling your own with Zenity

I'm not aware of any out of the box tool that will do this for you. I'd write a script to watch for the situation and then use something like zenity to pop a dialog up when the situation arises.

$ zenity --info --text="This is an information box."

                                              ss of zenity dialog

It's pretty easy to get started with it and it's extremely easy to embed these dialogs into crons and scripts if need be.


I personally use conky to keep an eye on things that are going on, on my system. It's highly configurable and can be coupled to your background so that it's always easily accessible.


Putting them together?

As a novel solution to your problem you could setup conky to watch for a particular situation, such as a process consuming all of your CPU resources, and then popping a dialog alerting you to the problem. I found this solution which shows a warning dialog being displayed when the battery got below a certain threshold. This solution was in a post titled: Low Battery Warning Using conky.

   BATTERY: ${color}${battery BAT0}
    ${if_match ${battery_percent BAT0} <= 10}
    ${if_match "${acpiacadapter}" == "off-line"}
    ${exec zenity --warning --text "Low Battery"}
  • Thanks for both tips. Does Conky warn you when something starts hogging the cpu?
    – alexis
    Mar 21, 2014 at 15:55

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.