Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Hint followup from submitter' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Hint followup from submitter
Authored by: migurski on Sep 22, '04 12:46:51PM

I submitted this hint, though foolishly did so without logging in first. Anyway, a few people rightly point out that CPU monitoring is an easy task, and can be done in the dock or desktop or what-have-you. I have a copy of GeekTool running which does just this on my desktop. The broader point of the suggestion was not about CPU usage (I could have chosen unread mail, feeds, or TCP connections as a metric), but about ambient, visual information. It's one thing to have a tiny graph or widget someplace, and quite another to have your entire environment smoothly change hue depending on a trigger. Try it, it's really cool. Like in submarine movies, when the s#!t hits the fan, and the whole movie turns red and ominous. :)



[ Reply to This | # ]
Hint followup from submitter
Authored by: darndog on Sep 28, '04 07:26:14AM
I Love it, modded it a little for my dual screen with left / right images from mandolux.com also made the warn image come up for minute averages over 5.0, load image still uses 5 min averages, unfamiliar with perl hence the lack of a decent if then else structure but it all works fine.
required files l-normal, l-load, l-warn, r-normal, r-load, r-warn, 'Left' and 'Right' folders for the active images.

My desktop (Elaine dual screen clouds from above site), now becomes overcast under load and downright threatening when under stress ;)
The load image works so much better for nightime use that I'm thinking of setting another cron job to switch that to the default after sun down by switching out the activate.pl file.


#!/usr/bin/perl

chomp(my $basedir = `dirname "$0"`);
chdir $basedir;

my $load_threshold = 1.9;
my $warn_threshold = 5.0;

if(($_ = `w`) && /load averages: +([\d\.]+) +([\d\.]+) +([\d\.]+)/) {
  if($2 <= $load_threshold) {
    $active_image_r = 'r-normal.jpg';
    $active_image_l = 'l-normal.jpg';
  }
  if($2 > $load_threshold) {
    $active_image_r = 'r-load.jpg';
    $active_image_l = 'l-load.jpg';
  }
  if($1 > $warn_threshold) {
    $active_image_r = 'r-warn.jpg';
    $active_image_l = 'l-warn.jpg';
  }

}

unlink("Right/active_a.jpg");
unlink("Right/active_b.jpg");
link($active_image_r, "Right/active_a.jpg");
link($active_image_r, "Right/active_b.jpg");
unlink("Left/active_a.jpg");
unlink("Left/active_b.jpg");
link($active_image_l, "Left/active_a.jpg");
link($active_image_l, "Left/active_b.jpg");
next job is to mod this for my laptop and use osascript to change the single desktop image rather than rotating the desktop.

[ Reply to This | # ]