Skip to content

Instantly share code, notes, and snippets.

@alexeiz
Created January 28, 2013 17:19
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexeiz/4657334 to your computer and use it in GitHub Desktop.
Save alexeiz/4657334 to your computer and use it in GitHub Desktop.
Patch for the default color scheme for htop that works well with the solarized terminal color theme.
diff -u -r a/CRT.c b/CRT.c
--- a/CRT.c 2012-10-19 14:59:28.000000000 -0400
+++ b/CRT.c 2013-01-28 12:08:36.812929000 -0500
@@ -562,7 +562,7 @@
CRT_colors[LED_COLOR] = ColorPair(Green,Black);
CRT_colors[TASKS_RUNNING] = A_BOLD | ColorPair(Green,Black);
CRT_colors[PROCESS] = A_NORMAL;
- CRT_colors[PROCESS_SHADOW] = A_BOLD | ColorPair(Black,Black);
+ CRT_colors[PROCESS_SHADOW] = A_BOLD | ColorPair(Green,Black);
CRT_colors[PROCESS_TAG] = A_BOLD | ColorPair(Yellow,Black);
CRT_colors[PROCESS_MEGABYTES] = ColorPair(Cyan,Black);
CRT_colors[PROCESS_BASENAME] = A_BOLD | ColorPair(Cyan,Black);
@@ -573,7 +573,7 @@
CRT_colors[PROCESS_THREAD] = ColorPair(Green,Black);
CRT_colors[PROCESS_THREAD_BASENAME] = A_BOLD | ColorPair(Green,Black);
CRT_colors[BAR_BORDER] = A_BOLD;
- CRT_colors[BAR_SHADOW] = A_BOLD | ColorPair(Black,Black);
+ CRT_colors[BAR_SHADOW] = A_BOLD | ColorPair(Green,Black);
CRT_colors[SWAP] = ColorPair(Red,Black);
CRT_colors[GRAPH_1] = A_BOLD | ColorPair(Red,Black);
CRT_colors[GRAPH_2] = ColorPair(Red,Black);
@@ -583,11 +583,11 @@
CRT_colors[GRAPH_6] = ColorPair(Cyan,Black);
CRT_colors[GRAPH_7] = A_BOLD | ColorPair(Blue,Black);
CRT_colors[GRAPH_8] = ColorPair(Blue,Black);
- CRT_colors[GRAPH_9] = A_BOLD | ColorPair(Black,Black);
+ CRT_colors[GRAPH_9] = A_BOLD | ColorPair(Green,Black);
CRT_colors[MEMORY_USED] = ColorPair(Green,Black);
CRT_colors[MEMORY_BUFFERS] = ColorPair(Blue,Black);
CRT_colors[MEMORY_CACHE] = ColorPair(Yellow,Black);
- CRT_colors[LOAD_AVERAGE_FIFTEEN] = A_BOLD | ColorPair(Black,Black);
+ CRT_colors[LOAD_AVERAGE_FIFTEEN] = A_BOLD | ColorPair(Green,Black);
CRT_colors[LOAD_AVERAGE_FIVE] = A_NORMAL;
CRT_colors[LOAD_AVERAGE_ONE] = A_BOLD;
CRT_colors[LOAD] = A_BOLD;
@@ -600,7 +600,7 @@
CRT_colors[CPU_NICE] = ColorPair(Blue,Black);
CRT_colors[CPU_NORMAL] = ColorPair(Green,Black);
CRT_colors[CPU_KERNEL] = ColorPair(Red,Black);
- CRT_colors[CPU_IOWAIT] = A_BOLD | ColorPair(Black, Black);
+ CRT_colors[CPU_IOWAIT] = A_BOLD | ColorPair(Green,Black);
CRT_colors[CPU_IRQ] = ColorPair(Yellow,Black);
CRT_colors[CPU_SOFTIRQ] = ColorPair(Magenta,Black);
CRT_colors[CPU_STEAL] = ColorPair(Cyan,Black);
@alexeiz
Copy link
Author

alexeiz commented Jan 28, 2013

BOLD | GREEN is displayed as gray in the solarized dark theme.

@unixsurfer
Copy link

thanks a lot

@TrevorBramble
Copy link

@alexeiz This is awesome, thanks. Have you tried submitting the patch? I couldn't find it in the SourceForge project.

@dzhus
Copy link

dzhus commented Jul 10, 2015

The patch fails with htop-1.0.3, but the fix is trivial (see https://gist.github.com/dzhus/ed6d7a790f74bb02f373)

@mrenouf
Copy link

mrenouf commented Dec 22, 2015

Also suggest:

- CRT_colors[PROCESS_TAG] = A_BOLD | ColorPair(Yellow,Black);

  • CRT_colors[PROCESS_TAG] = A_BOLD | ColorPair(Red,Black);

@antoineco
Copy link

Arch Linux has a package that includes these changes (pretty much): https://aur.archlinux.org/packages/htop-solarized/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment