You are not logged in.

#1 2011-08-19 03:01:36

triplesquarednine
Member
Registered: 2011-04-12
Posts: 630

Gnome-system-monitor (dark remix) 4 those using dark themes

hey fellow archers,

I'm a guy who digs dark themes, i am also someone who uses Gnome. Something that has irritated me for years is gnome-system-monitor ~ specifically, when using a dark theme. those white graphs (CPU graph), are just brutal. At work, i use CentOS on a couple of machines, while i don't use gnome with a server (obviously..lol) i have usedf CentOS with gnome before and had made note of the fact that it had a dark graph, and no ugly highlight bar in the 'system' tab, which was a little bit nicer on the eyes.

well, today i decided to fix the default colors for that graph, and i also decided to remove the stupid cairo-gradient that greets you in the 'system' tab. i did this because i prefer a nice graphic, over having a plain gnome logo, and a tacky gradient, it just doesn't need to be there.

here is what it looks like;

tOXlrOA   tOXlrYw  tOXlrZg

here is my gitorious branch where the sources are available;

git clone git://gitorious.org/gnome-system-monitor-blackgtk3/gnome-system-monitor-blackgtk3.git

you all use archlinux, so i need not explain how to compile it wink and this is gnome-system-monitor 3.1.4 (development) but i have not noticed any bugs whatsoever.

I am thinking of making a pkgbuild for AUR, that would pull from Gnome's git repo, and then apply a patch. Currently i have 2 roughed out patches (that work), but i have no experience writing patches, or even making pkgbuilds. if you are interested here is what i have got;

1. black-graph.patch

--- /home/ninez/Desktop/gnome-system-monitor/src/load-graph.cpp	2011-08-18 19:58:21.443838034 -0400
+++ /home/ninez/Desktop/gnome-system-monitor-3.1.4-NINEZ/src/load-graph.cpp	2011-08-18 19:50:24.000000000 -0400
@@ -76,7 +76,7 @@
     cairo_text_extents_t extents;
 
     num_bars = graph->num_bars();
-    graph->graph_dely = (graph->draw_height - 15) / num_bars; /* round to int to avoid AA blur */
+    graph->graph_dely = (graph->draw_height - 8) / num_bars; /* round to int to avoid AA blur */
     graph->real_draw_height = graph->graph_dely * num_bars;
     graph->graph_delx = (graph->draw_width - 2.0 - graph->rmargin - graph->indent) / (LoadGraph::NUM_POINTS - 3);
     graph->graph_buffer_offset = (int) (1.5 * graph->graph_delx) + FRAME_WIDTH ;
@@ -88,66 +88,67 @@
                                                        allocation.height);
     cr = cairo_create (graph->background);
 
-    // set the background colour
+    // set the background colour - cairo_set_source_rgb = outside of graph
     GtkStyle *style = gtk_widget_get_style (ProcData::get_instance()->notebook);
-    gdk_cairo_set_source_color (cr, &style->bg[GTK_STATE_NORMAL]);
+    gdk_cairo_set_source_color (cr, &style->bg[0, 0, 1, 1]);
+    cairo_set_source_rgb (cr, 0.10, 0.10, 0.10);
     cairo_paint (cr);
 
     /* draw frame */
     cairo_translate (cr, FRAME_WIDTH, FRAME_WIDTH);
 
-    /* Draw background rectangle */
-    cairo_set_source_rgb (cr, 1.0, 1.0, 1.0);
-    cairo_rectangle (cr, graph->rmargin + graph->indent, 0,
+    /* Draw background rectangle - inside graph */
+    cairo_set_source_rgb (cr, 0.10, 0.10, 0.10);
+    cairo_rectangle (cr, graph->rmargin + graph->indent, 1,
                      graph->draw_width - graph->rmargin - graph->indent, graph->real_draw_height);
     cairo_fill(cr);
 
-    cairo_set_line_width (cr, 1.0);
-    cairo_set_dash (cr, dash, 2, 0);
+    cairo_set_line_width (cr, 2.0);
+    cairo_set_dash (cr, dash, 2, 1);
     cairo_set_font_size (cr, graph->fontsize);
 
     for (i = 0; i <= num_bars; ++i) {
         double y;
 
         if (i == 0)
-            y = 0.5 + graph->fontsize / 2.0;
+            y = 0.5 + graph->fontsize / 3.0;
         else if (i == num_bars)
             y = i * graph->graph_dely + 0.5;
         else
-            y = i * graph->graph_dely + graph->fontsize / 2.0;
+            y = i * graph->graph_dely + graph->fontsize / 4.0;
 
-        gdk_cairo_set_source_color (cr, &style->fg[GTK_STATE_NORMAL]);
+        gdk_cairo_set_source_color (cr, &style->fg[1]);
         if (graph->type == LOAD_GRAPH_NET) {
             // operation orders matters so it's 0 if i == num_bars
             unsigned rate = graph->net.max - (i * graph->net.max / num_bars);
             const std::string caption(procman::format_network_rate(rate, graph->net.max));
             cairo_text_extents (cr, caption.c_str(), &extents);
-            cairo_move_to (cr, graph->indent - extents.width + 20, y);
+            cairo_move_to (cr, graph->indent - extents.width + 40, y);
             cairo_show_text (cr, caption.c_str());
         } else {
             // operation orders matters so it's 0 if i == num_bars
             caption = g_strdup_printf("%d %%", 100 - i * (100 / num_bars));
             cairo_text_extents (cr, caption, &extents);
-            cairo_move_to (cr, graph->indent - extents.width + 20, y);
+            cairo_move_to (cr, graph->indent - extents.width + 40, y);
             cairo_show_text (cr, caption);
             g_free (caption);
         }
 
-        cairo_set_source_rgba (cr, 0, 0, 0, 0.75);
+        cairo_set_source_rgba (cr, 0.7, 0.7, 0.7, 0.70);
         cairo_move_to (cr, graph->rmargin + graph->indent - 3, i * graph->graph_dely + 0.5);
         cairo_line_to (cr, graph->draw_width - 0.5, i * graph->graph_dely + 0.5);
     }
     cairo_stroke (cr);
 
-    cairo_set_dash (cr, dash, 2, 1.5);
+    cairo_set_dash (cr, dash, 2, 0.20);
 
     const unsigned total_seconds = graph->speed * (LoadGraph::NUM_POINTS - 2) / 1000;
 
     for (unsigned int i = 0; i < 7; i++) {
         double x = (i) * (graph->draw_width - graph->rmargin - graph->indent) / 6;
-        cairo_set_source_rgba (cr, 0, 0, 0, 0.75);
-        cairo_move_to (cr, (ceil(x) + 0.5) + graph->rmargin + graph->indent, 0.5);
-        cairo_line_to (cr, (ceil(x) + 0.5) + graph->rmargin + graph->indent, graph->real_draw_height + 4.5);
+        cairo_set_source_rgba (cr, 0.7, 0.7, 0.7, 0.75);
+        cairo_move_to (cr, (ceil(x) + 0.3) + graph->rmargin + graph->indent, 0.3);
+        cairo_line_to (cr, (ceil(x) + 0.3) + graph->rmargin + graph->indent, graph->real_draw_height + 4.5);
         cairo_stroke(cr);
         unsigned seconds = total_seconds - i * total_seconds / 6;
         const char* format;
@@ -158,7 +159,7 @@
         caption = g_strdup_printf(format, seconds);
         cairo_text_extents (cr, caption, &extents);
         cairo_move_to (cr, ((ceil(x) + 0.5) + graph->rmargin + graph->indent) - (extents.width/2), graph->draw_height);
-        gdk_cairo_set_source_color (cr, &style->fg[GTK_STATE_NORMAL]);
+        gdk_cairo_set_source_color (cr, &style->fg[1]);
         cairo_show_text (cr, caption);
         g_free (caption);
     }
@@ -226,20 +227,20 @@
     /* Subframe offset */
     x_offset += graph->rmargin - ((sample_width / graph->frames_per_unit) * graph->render_counter);
 
-    /* draw the graph */
+    /* draw the graph - LINE WIDTH 3 */
     cairo_t* cr;
 
     cr = gdk_cairo_create (window);
 
-    cairo_set_line_width (cr, 1);
+    cairo_set_line_width (cr, 2);
     cairo_set_line_cap (cr, CAIRO_LINE_CAP_ROUND);
     cairo_set_line_join (cr, CAIRO_LINE_JOIN_ROUND);
-    cairo_rectangle (cr, graph->rmargin + graph->indent + FRAME_WIDTH + 1, FRAME_WIDTH - 1,
+    cairo_rectangle (cr, graph->rmargin + graph->indent + FRAME_WIDTH + 2, FRAME_WIDTH - 2,
                      graph->draw_width - graph->rmargin - graph->indent - 1, graph->real_draw_height + FRAME_WIDTH - 1);
     cairo_clip(cr);
 
     for (j = 0; j < graph->n; ++j) {
-        cairo_move_to (cr, x_offset, (1.0f - graph->data[0][j]) * graph->real_draw_height);
+        cairo_move_to (cr, x_offset, (1.0f - graph->data[1][j]) * graph->real_draw_height);
         gdk_cairo_set_source_color (cr, &(graph->colors [j]));
 
         for (i = 1; i < LoadGraph::NUM_POINTS; ++i) {

2. no-highlight.patch

--- /home/ninez/Desktop/gnome-system-monitor/src/sysinfo.cpp	2011-08-18 19:58:21.443838034 -0400
+++ /home/ninez/Desktop/gnome-system-monitor-3.1.4-NINEZ/src/sysinfo.cpp	2011-08-18 16:03:52.000000000 -0400
@@ -477,7 +477,7 @@
                                       style->base[GTK_STATE_SELECTED].green / 65535.0,
                                       style->base[GTK_STATE_SELECTED].blue / 65535.0,
                                       1.0);
-    cairo_pattern_add_color_stop_rgba(cp, 1.0,
+    cairo_pattern_add_color_stop_rgba(cp, 0.0,
                                       style->base[GTK_STATE_SELECTED].red / 65535.0,
                                       style->base[GTK_STATE_SELECTED].green / 65535.0,
                                       style->base[GTK_STATE_SELECTED].blue / 65535.0,

EDIT: if you noticed the RGBA transparency where the icons are, that isn't a bug or something being misdrawn. My gtk3 theme is partially RGBA (in compiz only, not gnome-shell/mutter). the theme is 'Marples-black' found here;

http://gnome-look.org/content/show.php?content=144240

last note: My branch is only for the short term, until i get things sorted out. i also wanted to make the sources available to anyone, on any distro. so , it was easist to just quickly setup a branch, that anyone can pull from.

cheerz

Last edited by triplesquarednine (2011-08-19 03:58:42)

Offline

#2 2011-08-19 04:24:24

dodo3773
Member
Registered: 2011-03-17
Posts: 820

Re: Gnome-system-monitor (dark remix) 4 those using dark themes

Looks good. I could not even see the lines in my old one.

Offline

#3 2011-08-19 04:28:04

triplesquarednine
Member
Registered: 2011-04-12
Posts: 630

Re: Gnome-system-monitor (dark remix) 4 those using dark themes

dodo3773 wrote:

Looks good. I could not even see the lines in my old one.

thanks, im loving it smile

ya, i've actually edited the way the lines appear. The graph lines were originally 1 pixel wide, on a white background. i found that a bit straining on the eyes, so i moved it to 2 pixels. and since it's on a dark background ~ i can read the graph from across the room now...lol

then i doubled up the dotted lines as well, and played with the borders a little, and truncated the widgets/rectangle/graph. I think it looks better than the default.

thanks for the feedback!

cheerz

Last edited by triplesquarednine (2011-08-19 04:29:18)

Offline

#4 2011-08-19 04:35:16

dodo3773
Member
Registered: 2011-03-17
Posts: 820

Re: Gnome-system-monitor (dark remix) 4 those using dark themes

triplesquarednine wrote:
dodo3773 wrote:

Looks good. I could not even see the lines in my old one.

thanks, im loving it smile

ya, i've actually edited the way the lines appear. The graph lines were originally 1 pixel wide, on a white background. i found that a bit straining on the eyes, so i moved it to 2 pixels. and since it's on a dark background ~ i can read the graph from across the room now...lol

then i doubled up the dotted lines as well, and played with the borders a little, and truncated the widgets/rectangle/graph. I think it looks better than the default.

thanks for the feedback!

cheerz

Yeah, if it wasn't for dark themes / stylish I would probably be blind by now ha ha ha. Have you though about putting it in the aur? Maybe calling it gnome-system-monitor-dark or something?

Offline

#5 2011-08-19 04:47:50

triplesquarednine
Member
Registered: 2011-04-12
Posts: 630

Re: Gnome-system-monitor (dark remix) 4 those using dark themes

dodo3773 wrote:

Yeah, if it wasn't for dark themes / stylish I would probably be blind by now ha ha ha. Have you though about putting it in the aur? Maybe calling it gnome-system-monitor-dark or something?

I spend way too much time both at work/home in front of a computer. dark is the way to go. so much more relaxed on the eyes.

Yes, i have (thought about putting it into AUR).  in the short term it was just quicker to throw it up on my gitorious though. As i said above, i haven't really made too many patches, and i currently only maintain one package in AUR, so i have a little reading to do, first. that's also why i posted my patches. in case someone has something to point out, aside from the obvious thing - which is that i need to modify the first part of the patch, as i can ditch a 1st couple directories ... wink

Ideally, it will end up in AUR...  But, i will probably also have my gitorious branch sync'd to gnome's branch, and i will create a patch using GIT to maintain my branch ~ so that people outside the Arch community, can have easy access too. plus, who knows, i may change around some other things as well. in the 3-4 hours i have been using this 'mod', i am way happier than with the upstream version.

cheerz

Offline

#6 2011-08-19 05:42:30

dodo3773
Member
Registered: 2011-03-17
Posts: 820

Re: Gnome-system-monitor (dark remix) 4 those using dark themes

triplesquarednine wrote:
dodo3773 wrote:

Yeah, if it wasn't for dark themes / stylish I would probably be blind by now ha ha ha. Have you though about putting it in the aur? Maybe calling it gnome-system-monitor-dark or something?

I spend way too much time both at work/home in front of a computer. dark is the way to go. so much more relaxed on the eyes.

Yes, i have (thought about putting it into AUR).  in the short term it was just quicker to throw it up on my gitorious though. As i said above, i haven't really made too many patches, and i currently only maintain one package in AUR, so i have a little reading to do, first. that's also why i posted my patches. in case someone has something to point out, aside from the obvious thing - which is that i need to modify the first part of the patch, as i can ditch a 1st couple directories ... wink

Ideally, it will end up in AUR...  But, i will probably also have my gitorious branch sync'd to gnome's branch, and i will create a patch using GIT to maintain my branch ~ so that people outside the Arch community, can have easy access too. plus, who knows, i may change around some other things as well. in the 3-4 hours i have been using this 'mod', i am way happier than with the upstream version.

cheerz

Right on. Looking forward to further development. I will stay posted  (subscribed to thread).

Offline

#7 2011-08-19 06:04:43

triplesquarednine
Member
Registered: 2011-04-12
Posts: 630

Re: Gnome-system-monitor (dark remix) 4 those using dark themes

dodo3773 wrote:

Right on. Looking forward to further development. I will stay posted  (subscribed to thread).

Cool, I am glad you like it. I figured that i couldn't be the only person, who might prefer gnome-system-monitor to better match dark themes. it would have been nice, if whoever is/was developing gnome-system-monitor had implemented the graphs, so that the colors weren't hard-coded, but instead took advantage of colors/shades/tones in the users theme, having the graph itself sit on top / draw the background behind itself (which it doesn't),  beyond that having them customizable like some of the other colors are, ya know?

anyway, thanks again for the feedback. I do this stuff just for fun, but it's always nice to hear that someone is making use of it, and likes it. awesome stuff.

anyway, i am off to sleep. have a good one!

later smile

Last edited by triplesquarednine (2011-08-19 06:07:30)

Offline

Board footer

Powered by FluxBB