mirror of
https://github.com/Dr-Noob/cpufetch.git
synced 2026-03-25 07:50:40 +01:00
[v0.98][PPC] Added IBM color scheme
This commit is contained in:
@@ -37,6 +37,9 @@ Use Intel default color scheme
|
|||||||
* "amd":
|
* "amd":
|
||||||
Use AMD default color scheme
|
Use AMD default color scheme
|
||||||
.TP
|
.TP
|
||||||
|
* "ibm":
|
||||||
|
Use IBM default color scheme
|
||||||
|
.TP
|
||||||
* "arm":
|
* "arm":
|
||||||
Use ARM default color scheme
|
Use ARM default color scheme
|
||||||
.TP
|
.TP
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
#define COLOR_STR_INTEL "intel"
|
#define COLOR_STR_INTEL "intel"
|
||||||
#define COLOR_STR_AMD "amd"
|
#define COLOR_STR_AMD "amd"
|
||||||
|
#define COLOR_STR_IBM "ibm"
|
||||||
#define COLOR_STR_ARM "arm"
|
#define COLOR_STR_ARM "arm"
|
||||||
|
|
||||||
static const char *SYTLES_STR_LIST[] = {
|
static const char *SYTLES_STR_LIST[] = {
|
||||||
@@ -131,6 +132,11 @@ bool parse_color(char* optarg_str, struct colors** cs) {
|
|||||||
strcpy(str_to_parse, COLOR_DEFAULT_AMD);
|
strcpy(str_to_parse, COLOR_DEFAULT_AMD);
|
||||||
free_ptr = true;
|
free_ptr = true;
|
||||||
}
|
}
|
||||||
|
else if(strcmp(optarg_str, COLOR_STR_IBM) == 0) {
|
||||||
|
str_to_parse = malloc(sizeof(char) * 45);
|
||||||
|
strcpy(str_to_parse, COLOR_DEFAULT_IBM);
|
||||||
|
free_ptr = true;
|
||||||
|
}
|
||||||
else if(strcmp(optarg_str, COLOR_STR_ARM) == 0) {
|
else if(strcmp(optarg_str, COLOR_STR_ARM) == 0) {
|
||||||
str_to_parse = malloc(sizeof(char) * 46);
|
str_to_parse = malloc(sizeof(char) * 46);
|
||||||
strcpy(str_to_parse, COLOR_DEFAULT_ARM);
|
strcpy(str_to_parse, COLOR_DEFAULT_ARM);
|
||||||
|
|||||||
@@ -61,8 +61,9 @@ void print_help(char *argv[]) {
|
|||||||
printf("\nCOLORS: \n");
|
printf("\nCOLORS: \n");
|
||||||
printf(" * \"intel\": Use Intel default color scheme \n");
|
printf(" * \"intel\": Use Intel default color scheme \n");
|
||||||
printf(" * \"amd\": Use AMD default color scheme \n");
|
printf(" * \"amd\": Use AMD default color scheme \n");
|
||||||
|
printf(" * \"ibm\", Use IBM default color scheme \n");
|
||||||
printf(" * \"arm\": Use ARM default color scheme \n");
|
printf(" * \"arm\": Use ARM default color scheme \n");
|
||||||
printf(" * custom: If color argument do not match \"intel\", \"amd\" or \"arm\", a custom scheme can be specified.\n");
|
printf(" * custom: If color argument do not match \"intel\", \"amd\", \"ibm\" or \"arm\", a custom scheme can be specified.\n");
|
||||||
printf(" 4 colors must be given in RGB with the format: R,G,B:R,G,B:...\n");
|
printf(" 4 colors must be given in RGB with the format: R,G,B:R,G,B:...\n");
|
||||||
printf(" The first 2 colors are the CPU art color and the next 2 colors are the text colors\n");
|
printf(" The first 2 colors are the CPU art color and the next 2 colors are the text colors\n");
|
||||||
|
|
||||||
|
|||||||
@@ -520,10 +520,8 @@ bool print_cpufetch_x86(struct cpuInfo* cpu, STYLE s, struct colors* cs) {
|
|||||||
#ifdef ARCH_PPC
|
#ifdef ARCH_PPC
|
||||||
void print_algorithm_ppc(struct ascii* art, int n) {
|
void print_algorithm_ppc(struct ascii* art, int n) {
|
||||||
for(int i=0; i < LINE_SIZE; i++) {
|
for(int i=0; i < LINE_SIZE; i++) {
|
||||||
if(art->art[n][i] == '@')
|
if(art->art[n][i] == '#')
|
||||||
printf("%s%c%s", art->color1_ascii, art->ascii_chars[0], art->reset);
|
printf("%s%c%s", art->color1_ascii, art->ascii_chars[0], art->reset);
|
||||||
else if(art->art[n][i] == '#')
|
|
||||||
printf("%s%c%s", art->color2_ascii, art->ascii_chars[1], art->reset);
|
|
||||||
else
|
else
|
||||||
printf("%c",art->art[n][i]);
|
printf("%c",art->art[n][i]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ typedef int STYLE;
|
|||||||
|
|
||||||
#define COLOR_DEFAULT_INTEL "15,125,194:230,230,230:40,150,220:230,230,230"
|
#define COLOR_DEFAULT_INTEL "15,125,194:230,230,230:40,150,220:230,230,230"
|
||||||
#define COLOR_DEFAULT_AMD "250,250,250:0,154,102:250,250,250:0,154,102"
|
#define COLOR_DEFAULT_AMD "250,250,250:0,154,102:250,250,250:0,154,102"
|
||||||
|
#define COLOR_DEFAULT_IBM "92,119,172:92,119,172:240,240,240:92,119,172"
|
||||||
#define COLOR_DEFAULT_ARM "0,145,189:0,145,189:240,240,240:0,145,189"
|
#define COLOR_DEFAULT_ARM "0,145,189:0,145,189:240,240,240:0,145,189"
|
||||||
|
|
||||||
#ifdef ARCH_X86
|
#ifdef ARCH_X86
|
||||||
|
|||||||
Reference in New Issue
Block a user