Add hardware uwuification
This commit is contained in:
parent
034147f515
commit
47f6fed2b4
1 changed files with 44 additions and 0 deletions
44
uwufetch.c
44
uwufetch.c
|
@ -13,6 +13,8 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define _GNU_SOURCE // for strcasestr
|
||||||
|
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -102,12 +104,14 @@ void parse_config();
|
||||||
void get_info();
|
void get_info();
|
||||||
void list();
|
void list();
|
||||||
void replace(char *original, char *search, char *replacer);
|
void replace(char *original, char *search, char *replacer);
|
||||||
|
void replace_ignorecase(char *original, char *search, char *replacer);
|
||||||
void print_ascii();
|
void print_ascii();
|
||||||
void print_unknown_ascii();
|
void print_unknown_ascii();
|
||||||
void print_info();
|
void print_info();
|
||||||
void print_image();
|
void print_image();
|
||||||
void usage(char *);
|
void usage(char *);
|
||||||
void uwu_kernel();
|
void uwu_kernel();
|
||||||
|
void uwu_hw(char *);
|
||||||
void uwu_name();
|
void uwu_name();
|
||||||
void truncate_name(char *);
|
void truncate_name(char *);
|
||||||
void remove_brackets(char *);
|
void remove_brackets(char *);
|
||||||
|
@ -166,6 +170,13 @@ int main(int argc, char *argv[])
|
||||||
print_image();
|
print_image();
|
||||||
uwu_kernel();
|
uwu_kernel();
|
||||||
uwu_name();
|
uwu_name();
|
||||||
|
|
||||||
|
for (int i = 0; gpu_model[i][0]; i++) {
|
||||||
|
uwu_hw(gpu_model[i]);
|
||||||
|
}
|
||||||
|
uwu_hw(cpu_model);
|
||||||
|
uwu_hw(host_model);
|
||||||
|
|
||||||
print_info();
|
print_info();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -687,6 +698,20 @@ void replace(char *original, char *search, char *replacer) {
|
||||||
return replace(original, search, replacer);
|
return replace(original, search, replacer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void replace_ignorecase(char *original, char *search, char *replacer) {
|
||||||
|
char buffer[1024];
|
||||||
|
char *ch;
|
||||||
|
if(!(ch = strcasestr(original, search))) return;
|
||||||
|
|
||||||
|
strncpy(buffer, original, ch-original);
|
||||||
|
buffer[ch-original] = 0;
|
||||||
|
sprintf(buffer+(ch - original), "%s%s", replacer, ch + strlen(search));
|
||||||
|
|
||||||
|
original[0] = 0;
|
||||||
|
strcpy(original, buffer);
|
||||||
|
return replace(original, search, replacer);
|
||||||
|
}
|
||||||
|
|
||||||
void print_ascii()
|
void print_ascii()
|
||||||
{ // prints logo (as ascii art) of the given system. distributions listed alphabetically.
|
{ // prints logo (as ascii art) of the given system. distributions listed alphabetically.
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
@ -1093,6 +1118,25 @@ void uwu_kernel()
|
||||||
#undef KERNEL_TO_UWU
|
#undef KERNEL_TO_UWU
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void uwu_hw(char *hwname)
|
||||||
|
{
|
||||||
|
#define HW_TO_UWU(original, uwuified) \
|
||||||
|
replace_ignorecase(hwname, original, uwuified);
|
||||||
|
|
||||||
|
HW_TO_UWU("lenovo", "LenOwO")
|
||||||
|
HW_TO_UWU("cpu", "CPUwU")
|
||||||
|
HW_TO_UWU("gpu", "GPUwU")
|
||||||
|
HW_TO_UWU("graphics", "Gwaphics")
|
||||||
|
HW_TO_UWU("corporation", "COwOpowation")
|
||||||
|
HW_TO_UWU("nvidia", "NyaVIDIA")
|
||||||
|
HW_TO_UWU("mobile", "MOwObile")
|
||||||
|
HW_TO_UWU("intel", "Inteww")
|
||||||
|
HW_TO_UWU("proliant", "PrOwOliant")
|
||||||
|
HW_TO_UWU("proliant", "PrOwOliant")
|
||||||
|
|
||||||
|
#undef HW_TO_UWU
|
||||||
|
}
|
||||||
|
|
||||||
void uwu_name()
|
void uwu_name()
|
||||||
{ // uwufies distro name
|
{ // uwufies distro name
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue