Advertisement
ananas

htop new color theme

May 15th, 2014
317
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 6.12 KB | None | 0 0
  1. diff -urNp htop-1.0.3-orig/ColorsPanel.c htop-1.0.3/ColorsPanel.c
  2. --- htop-1.0.3-orig/ColorsPanel.c   2014-01-14 01:02:42.000000000 +0200
  3. +++ htop-1.0.3/ColorsPanel.c    2014-05-14 11:21:27.746610242 +0300
  4. @@ -41,6 +41,7 @@ static const char* ColorSchemes[] = {
  5.     "Light Terminal",
  6.     "MC",
  7.     "Black Night",
  8. +   "Implix",
  9.     NULL
  10.  };
  11.  
  12. diff -urNp htop-1.0.3-orig/CRT.c htop-1.0.3/CRT.c
  13. --- htop-1.0.3-orig/CRT.c   2014-04-24 19:13:56.000000000 +0300
  14. +++ htop-1.0.3/CRT.c    2014-05-14 11:20:50.193277586 +0300
  15. @@ -20,24 +20,6 @@ in the source distribution for its full
  16.  #include <execinfo.h>
  17.  #endif
  18.  
  19. -#define ColorPair(i,j) COLOR_PAIR((7-i)*8+j)
  20. -
  21. -#define COLORSCHEME_DEFAULT 0
  22. -#define COLORSCHEME_MONOCHROME 1
  23. -#define COLORSCHEME_BLACKONWHITE 2
  24. -#define COLORSCHEME_BLACKONWHITE2 3
  25. -#define COLORSCHEME_MIDNIGHT 4
  26. -#define COLORSCHEME_BLACKNIGHT 5
  27. -
  28. -#define Black COLOR_BLACK
  29. -#define Red COLOR_RED
  30. -#define Green COLOR_GREEN
  31. -#define Yellow COLOR_YELLOW
  32. -#define Blue COLOR_BLUE
  33. -#define Magenta COLOR_MAGENTA
  34. -#define Cyan COLOR_CYAN
  35. -#define White COLOR_WHITE
  36. -
  37.  //#link curses
  38.  
  39.  /*{
  40. @@ -568,6 +550,69 @@ void CRT_setColors(int colorScheme) {
  41.        CRT_colors[CPU_SOFTIRQ] = ColorPair(Blue,Black);
  42.        CRT_colors[CPU_STEAL] = ColorPair(Cyan,Black);
  43.        CRT_colors[CPU_GUEST] = ColorPair(Cyan,Black);
  44. +   } else if (CRT_colorScheme == COLORSCHEME_IMPLIX) {
  45. +      CRT_colors[RESET_COLOR] = ColorPair(White,Black);
  46. +      CRT_colors[DEFAULT_COLOR] = ColorPair(White,Black);
  47. +      CRT_colors[FUNCTION_BAR] = ColorPair(Black,Cyan);
  48. +      CRT_colors[FUNCTION_KEY] = ColorPair(Red,Cyan);
  49. +      CRT_colors[PANEL_HEADER_FOCUS] = ColorPair(White,Blue);
  50. +      CRT_colors[PANEL_HEADER_UNFOCUS] = ColorPair(White,Blue);
  51. +      CRT_colors[PANEL_HIGHLIGHT_FOCUS] = ColorPair(Black,Yellow);
  52. +      CRT_colors[PANEL_HIGHLIGHT_UNFOCUS] = ColorPair(White,Blue);
  53. +      CRT_colors[FAILED_SEARCH] = ColorPair(Red,Cyan);
  54. +      CRT_colors[UPTIME] = A_BOLD | ColorPair(Cyan,Black);
  55. +      CRT_colors[BATTERY] = A_BOLD | ColorPair(Cyan,Black);
  56. +      CRT_colors[LARGE_NUMBER] = A_BOLD | ColorPair(Red,Black);
  57. +      CRT_colors[METER_TEXT] = ColorPair(Cyan,Black);
  58. +      CRT_colors[METER_VALUE] = A_BOLD | ColorPair(Cyan,Black);
  59. +      CRT_colors[LED_COLOR] = ColorPair(Green,Black);
  60. +      CRT_colors[TASKS_RUNNING] = A_BOLD | ColorPair(Green,Black);
  61. +      CRT_colors[PROCESS] = A_NORMAL;
  62. +      CRT_colors[PROCESS_SHADOW] = A_BOLD | ColorPair(Black,Black);
  63. +      CRT_colors[PROCESS_TAG] = A_BOLD | ColorPair(Yellow,Black);
  64. +      CRT_colors[PROCESS_MEGABYTES] = ColorPair(Cyan,Black);
  65. +      CRT_colors[PROCESS_BASENAME] = A_BOLD | ColorPair(Cyan,Black);
  66. +      CRT_colors[PROCESS_TREE] = ColorPair(Cyan,Black);
  67. +      CRT_colors[PROCESS_R_STATE] = ColorPair(Green,Black);
  68. +      CRT_colors[PROCESS_HIGH_PRIORITY] = ColorPair(Red,Black);
  69. +      CRT_colors[PROCESS_LOW_PRIORITY] = ColorPair(Red,Black);
  70. +      CRT_colors[PROCESS_THREAD] = ColorPair(Green,Black);
  71. +      CRT_colors[PROCESS_THREAD_BASENAME] = A_BOLD | ColorPair(Green,Black);
  72. +      CRT_colors[BAR_BORDER] = A_BOLD;
  73. +      CRT_colors[BAR_SHADOW] = A_BOLD | ColorPair(Black,Black);
  74. +      CRT_colors[SWAP] = ColorPair(Red,Black);
  75. +      CRT_colors[GRAPH_1] = A_BOLD | ColorPair(Red,Black);
  76. +      CRT_colors[GRAPH_2] = ColorPair(Red,Black);
  77. +      CRT_colors[GRAPH_3] = A_BOLD | ColorPair(Yellow,Black);
  78. +      CRT_colors[GRAPH_4] = A_BOLD | ColorPair(Green,Black);
  79. +      CRT_colors[GRAPH_5] = ColorPair(Green,Black);
  80. +      CRT_colors[GRAPH_6] = ColorPair(Cyan,Black);
  81. +      CRT_colors[GRAPH_7] = A_BOLD | ColorPair(Blue,Black);
  82. +      CRT_colors[GRAPH_8] = ColorPair(Blue,Black);
  83. +      CRT_colors[GRAPH_9] = A_BOLD | ColorPair(Black,Black);
  84. +      CRT_colors[MEMORY_USED] = ColorPair(Green,Black);
  85. +      CRT_colors[MEMORY_BUFFERS] = ColorPair(Blue,Black);
  86. +      CRT_colors[MEMORY_BUFFERS_TEXT] = A_BOLD | ColorPair(Blue,Black);
  87. +      CRT_colors[MEMORY_CACHE] = ColorPair(Yellow,Black);
  88. +      CRT_colors[LOAD_AVERAGE_FIFTEEN] = A_BOLD | ColorPair(Black,Black);
  89. +      CRT_colors[LOAD_AVERAGE_FIVE] = A_NORMAL;
  90. +      CRT_colors[LOAD_AVERAGE_ONE] = A_BOLD;
  91. +      CRT_colors[LOAD] = A_BOLD;
  92. +      CRT_colors[HELP_BOLD] = A_BOLD | ColorPair(Cyan,Black);
  93. +      CRT_colors[CLOCK] = A_BOLD;
  94. +      CRT_colors[CHECK_BOX] = ColorPair(Cyan,Black);
  95. +      CRT_colors[CHECK_MARK] = A_BOLD;
  96. +      CRT_colors[CHECK_TEXT] = A_NORMAL;
  97. +      CRT_colors[HOSTNAME] = A_BOLD;
  98. +      CRT_colors[CPU_NICE] = ColorPair(Blue,Black);
  99. +      CRT_colors[CPU_NICE_TEXT] = A_BOLD | ColorPair(Blue,Black);
  100. +      CRT_colors[CPU_NORMAL] = ColorPair(Green,Black);
  101. +      CRT_colors[CPU_KERNEL] = ColorPair(Red,Black);
  102. +      CRT_colors[CPU_IOWAIT] = A_BOLD | ColorPair(Black, Black);
  103. +      CRT_colors[CPU_IRQ] = ColorPair(Yellow,Black);
  104. +      CRT_colors[CPU_SOFTIRQ] = ColorPair(Magenta,Black);
  105. +      CRT_colors[CPU_STEAL] = ColorPair(Cyan,Black);
  106. +      CRT_colors[CPU_GUEST] = ColorPair(Cyan,Black);
  107.     } else {
  108.        /* Default */
  109.        CRT_colors[RESET_COLOR] = ColorPair(White,Black);
  110. diff -urNp htop-1.0.3-orig/CRT.h htop-1.0.3/CRT.h
  111. --- htop-1.0.3-orig/CRT.h   2014-04-24 19:14:50.000000000 +0300
  112. +++ htop-1.0.3/CRT.h    2014-05-14 11:17:27.859947902 +0300
  113. @@ -20,6 +20,7 @@ in the source distribution for its full
  114.  #define COLORSCHEME_BLACKONWHITE2 3
  115.  #define COLORSCHEME_MIDNIGHT 4
  116.  #define COLORSCHEME_BLACKNIGHT 5
  117. +#define COLORSCHEME_IMPLIX 6
  118.  
  119.  #define Black COLOR_BLACK
  120.  #define Red COLOR_RED
  121. diff -urNp htop-1.0.3-orig/Settings.c htop-1.0.3/Settings.c
  122. --- htop-1.0.3-orig/Settings.c  2014-04-25 01:49:49.000000000 +0300
  123. +++ htop-1.0.3/Settings.c   2014-05-14 11:22:45.376608843 +0300
  124. @@ -135,7 +135,7 @@ static bool Settings_read(Settings* this
  125.        } else if (String_eq(option[0], "color_scheme")) {
  126.           this->colorScheme = atoi(option[1]);
  127.           if (this->colorScheme < 0) this->colorScheme = 0;
  128. -         if (this->colorScheme > 5) this->colorScheme = 5;
  129. +         if (this->colorScheme > 6) this->colorScheme = 6;
  130.        } else if (String_eq(option[0], "left_meters")) {
  131.           Settings_readMeters(this, option[1], LEFT_HEADER);
  132.           readMeters = true;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement