mirror of
https://github.com/Dr-Noob/cpufetch.git
synced 2026-03-25 07:50:40 +01:00
Compare commits
4 Commits
8ce24150e7
...
ascii
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ae53d97a47 | ||
|
|
eeeaec3ba9 | ||
|
|
7c5a0c3280 | ||
|
|
d4ad5a58f0 |
File diff suppressed because one or more lines are too long
19
src/common/ascii/amd.txt
Normal file
19
src/common/ascii/amd.txt
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
████ ███ ███ ████████ ▜███████████
|
||||||
|
██████ █████ █████ ███ ███ ▗▀▀▀▀▀▀▜███
|
||||||
|
███ ███ █████████████ ███ ██ ▐█ ▐███
|
||||||
|
███ ███ ███ ███ ███ ███ ██ ▟██ ▐███
|
||||||
|
████████████ ███ ███ ███ ███ ████▄▄▄▄▄▄▝▜██
|
||||||
|
███ ███ ███ ███ █████████ ████████▛ ██
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
3
src/common/ascii/convert.sh
Executable file
3
src/common/ascii/convert.sh
Executable file
@@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
cat intel.txt | hexdump -vC | head -n-1 | cut -d' ' -f2- | cut -d'|' -f1 | tr '\n' ' ' | tr -s ' ' | tr ' ' ',' | sed "s/,/,0x/g"
|
||||||
19
src/common/ascii/intel.txt
Normal file
19
src/common/ascii/intel.txt
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
▁▂▃▄▅▆▆▇▇███████▇▇▆▅▅▄▂▁
|
||||||
|
▁▃▄▆▇▛▀▀▀▀▔▔▔ ▔▔▔▀▀▀██▇▅▃
|
||||||
|
▂▄▆█▀▀▔ ▝▜██▅▁
|
||||||
|
▀▀▔ ▔▜██▖
|
||||||
|
▅▅▅ ▆▆▆ ▜██▖
|
||||||
|
▁▅ ▀▀▀ ▐██▌ ███ ██▉
|
||||||
|
▄▛▘ ▄▄▄ ▗▄▄▄▄▄▄▃▁ ▐██▙▄▖ ▁▃▄▅▄▃ ███ ███
|
||||||
|
▗▟▛ ███ ▐██▀▀▀▜██▖ ▐██▛▀▘ ▟██▀▀▀██▖ ███ ▗██▊
|
||||||
|
█▛ ███ ▐██ ▕██▌ ▐██▌ ▐██▂▂▂▂▂██ ███ ▗███▘
|
||||||
|
▐█▍ ███ ▐██ ▕██▌ ▐██▌ ▐██▛▀▀▀▀▀▀ ███ ▄██▛▘
|
||||||
|
██▏ ███ ▐██ ▕██▌ ▐██▌ ▝██▙▁ ▁▂▃ ███ ▅███▀
|
||||||
|
██▍ ▝██ ▐██ ▕██▌ ▀███▋ ▝▀█████▛ ▝▜█ █▀▔
|
||||||
|
▐█▙ ▔▔▔
|
||||||
|
▜█▙▖ ▁▂▄▖
|
||||||
|
▜██▆▃▁ ▁▂▄▅▇███▌
|
||||||
|
▝▜███▇▅▄▃▂▁ ▁▁▂▃▄▅▆▇███████▀▀
|
||||||
|
▔▀▀████████▇▇▇▇▇▇▇▇▇▇███████████▛▀▀▔▔
|
||||||
|
▔▔▀▀▀▀█████████████▀▀▀▀▀▔▔▔
|
||||||
|
|
||||||
@@ -105,6 +105,7 @@ struct attribute {
|
|||||||
|
|
||||||
struct ascii {
|
struct ascii {
|
||||||
char art[NUMBER_OF_LINES][LINE_SIZE+1];
|
char art[NUMBER_OF_LINES][LINE_SIZE+1];
|
||||||
|
unsigned char* art_unicode;
|
||||||
char color1_ascii[100];
|
char color1_ascii[100];
|
||||||
char color2_ascii[100];
|
char color2_ascii[100];
|
||||||
char color1_text[100];
|
char color1_text[100];
|
||||||
@@ -159,8 +160,8 @@ struct ascii* set_ascii(VENDOR vendor, STYLE style, struct colors* cs) {
|
|||||||
|
|
||||||
#ifdef ARCH_X86
|
#ifdef ARCH_X86
|
||||||
if(art->vendor == CPU_VENDOR_INTEL) {
|
if(art->vendor == CPU_VENDOR_INTEL) {
|
||||||
COL_FANCY_1 = COLOR_BG_CYAN;
|
COL_FANCY_1 = COLOR_FG_CYAN;
|
||||||
COL_FANCY_2 = COLOR_BG_WHITE;
|
COL_FANCY_2 = COLOR_FG_WHITE;
|
||||||
COL_FANCY_3 = COLOR_FG_CYAN;
|
COL_FANCY_3 = COLOR_FG_CYAN;
|
||||||
COL_FANCY_4 = COLOR_FG_WHITE;
|
COL_FANCY_4 = COLOR_FG_WHITE;
|
||||||
art->ascii_chars[0] = '#';
|
art->ascii_chars[0] = '#';
|
||||||
@@ -262,6 +263,12 @@ struct ascii* set_ascii(VENDOR vendor, STYLE style, struct colors* cs) {
|
|||||||
if(cs != NULL) {
|
if(cs != NULL) {
|
||||||
COL_FANCY_1 = rgb_to_ansi(cs->c1, true, true);
|
COL_FANCY_1 = rgb_to_ansi(cs->c1, true, true);
|
||||||
COL_FANCY_2 = rgb_to_ansi(cs->c2, true, true);
|
COL_FANCY_2 = rgb_to_ansi(cs->c2, true, true);
|
||||||
|
#ifdef ARCH_X86
|
||||||
|
if(art->vendor == CPU_VENDOR_INTEL) {
|
||||||
|
COL_FANCY_1 = rgb_to_ansi(cs->c1, false, true);
|
||||||
|
COL_FANCY_2 = rgb_to_ansi(cs->c2, false, true);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
COL_FANCY_3 = rgb_to_ansi(cs->c3, false, true);
|
COL_FANCY_3 = rgb_to_ansi(cs->c3, false, true);
|
||||||
COL_FANCY_4 = rgb_to_ansi(cs->c4, false, true);
|
COL_FANCY_4 = rgb_to_ansi(cs->c4, false, true);
|
||||||
}
|
}
|
||||||
@@ -303,9 +310,11 @@ struct ascii* set_ascii(VENDOR vendor, STYLE style, struct colors* cs) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
char tmp[NUMBER_OF_LINES * LINE_SIZE + 1];
|
char tmp[NUMBER_OF_LINES * LINE_SIZE + 1];
|
||||||
|
art->art_unicode = NULL;
|
||||||
|
|
||||||
#ifdef ARCH_X86
|
#ifdef ARCH_X86
|
||||||
if(art->vendor == CPU_VENDOR_INTEL)
|
if(art->vendor == CPU_VENDOR_INTEL)
|
||||||
strcpy(tmp, INTEL_ASCII);
|
art->art_unicode = art_unicode_intel;
|
||||||
else if(art->vendor == CPU_VENDOR_AMD)
|
else if(art->vendor == CPU_VENDOR_AMD)
|
||||||
strcpy(tmp, AMD_ASCII);
|
strcpy(tmp, AMD_ASCII);
|
||||||
else
|
else
|
||||||
@@ -325,8 +334,11 @@ struct ascii* set_ascii(VENDOR vendor, STYLE style, struct colors* cs) {
|
|||||||
strcpy(tmp, ARM_ASCII);
|
strcpy(tmp, ARM_ASCII);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for(int i=0; i < NUMBER_OF_LINES; i++)
|
if(art->art_unicode != NULL) {
|
||||||
memcpy(art->art[i], tmp + i*LINE_SIZE, LINE_SIZE);
|
for(int i=0; i < NUMBER_OF_LINES; i++) {
|
||||||
|
memcpy(art->art[i], tmp + i*LINE_SIZE, LINE_SIZE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return art;
|
return art;
|
||||||
}
|
}
|
||||||
@@ -347,24 +359,26 @@ uint32_t longest_attribute_length(struct ascii* art) {
|
|||||||
|
|
||||||
#ifdef ARCH_X86
|
#ifdef ARCH_X86
|
||||||
void print_algorithm_intel(struct ascii* art, int n, bool* flag) {
|
void print_algorithm_intel(struct ascii* art, int n, bool* flag) {
|
||||||
for(int i=0; i < LINE_SIZE; i++) {
|
*flag = false;
|
||||||
if(*flag) {
|
int start = -1;
|
||||||
if(art->art[n][i] == ' ') {
|
for(int i=0, newlines=0; newlines < n; i++) {
|
||||||
*flag = false;
|
if(art->art_unicode[i] == '\n') {
|
||||||
printf("%s%c%s", art->color2_ascii, art->ascii_chars[1], art->reset);
|
newlines++;
|
||||||
}
|
start = i;
|
||||||
else {
|
}
|
||||||
printf("%s%c%s", art->color1_ascii, art->ascii_chars[0], art->reset);
|
}
|
||||||
}
|
|
||||||
|
for(int i=start+1, x=0; art->art_unicode[i] != '\n'; i++, x++) {
|
||||||
|
if(art->art_unicode[i] == ' ') {
|
||||||
|
printf(" ");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if(art->art[n][i] != ' ' && art->art[n][i] != '\0') {
|
printf("%s", art->color1_ascii);
|
||||||
*flag = true;
|
printf("%c", art->art_unicode[i]);
|
||||||
printf("%c",' ');
|
printf("%c", art->art_unicode[i + 1]);
|
||||||
}
|
printf("%c", art->art_unicode[i + 2]);
|
||||||
else {
|
printf("%s", COLOR_RESET);
|
||||||
printf("%c",' ');
|
i += 2;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user