diff --git a/wmmon/README b/wmmon/README index a0f56ac..c9e03f0 100644 --- a/wmmon/README +++ b/wmmon/README @@ -30,6 +30,10 @@ WMMon currently provides: * Realtime CPU 'stress' meter; * Average systemload, like xload & wmavgload; * Average systemload graphic is autoscaling; + * Hint lines change color as the systemload increases. + - Green for multiples of 1 + - Yellow for multiples of 10 + - Red for multiples of 100 * Realtime Disk I/O 'stress' meter; * Average Disk I/O load grapic (autoscaling); * Realtime total Mem & Swap usage meters; diff --git a/wmmon/wmmon-master.xpm b/wmmon/wmmon-master.xpm index 7e492c9..baceba2 100644 --- a/wmmon/wmmon-master.xpm +++ b/wmmon/wmmon-master.xpm @@ -134,8 +134,8 @@ static char * wmmon_master_xpm[] = { " s ", " X ", " d ", -" ", -" ", +" e ", +" i ", " ", " ", " ", diff --git a/wmmon/wmmon.1 b/wmmon/wmmon.1 index ab8f22e..e88350a 100644 --- a/wmmon/wmmon.1 +++ b/wmmon/wmmon.1 @@ -45,6 +45,16 @@ an auto-scaled average system load meter, like and .BR wmavgload ; .IP \(bu +hint lines change color as the system load increases. +.RS +.IP \(bu +green for multiples of 1 +.IP \(bu +yellow for multiples of 10 +.IP \(bu +red for multiples of 100 +.RE +.IP \(bu a realtime disk I/O stress meter; .IP \(bu auto-scaled disk I/O load meter; diff --git a/wmmon/wmmon.c b/wmmon/wmmon.c index d37c170..737bed6 100644 --- a/wmmon/wmmon.c +++ b/wmmon/wmmon.c @@ -904,7 +904,7 @@ void DrawActive(char *name) \*******************************************************************************/ void DrawStats(int *his, int num, int size, int x_left, int y_bottom) { - int pixels_per_byte, j, k, *p, d; + int pixels_per_byte, j, k, *p, d, hint_height, hint_color; pixels_per_byte = 100; p = his; @@ -932,10 +932,21 @@ void DrawStats(int *his, int num, int size, int x_left, int y_bottom) } /* Nu horizontaal op 100/200/300 etc lijntje trekken! */ - for (j = pixels_per_byte-100; j > 0; j-=100) { - d = (40.0 / pixels_per_byte) * j; + if (pixels_per_byte > 10000) { + hint_height = 10000; + hint_color = 93; /* red */ + } else if (pixels_per_byte > 1000) { + hint_height = 1000; + hint_color = 92; /* yellow */ + } else { + hint_height = 100; + hint_color = 91; /* green */ + } + + for (j = hint_height; j < pixels_per_byte; j += hint_height) { + d = (40.0 / pixels_per_byte) * j - 1; for (k=0; k