From 29de794e564ebd3a63cbac95a33dc2b0ccedb6e4 Mon Sep 17 00:00:00 2001 From: Guaxinim5573 Date: Sun, 4 Jul 2021 14:38:10 -0300 Subject: [PATCH] Uwufy kernel name --- uwufetch.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/uwufetch.c b/uwufetch.c index 0395be0..cbfc5d6 100644 --- a/uwufetch.c +++ b/uwufetch.c @@ -101,6 +101,7 @@ void print_ascii(); void print_info(); void print_image(); void usage(char *); +void uwu_kernel(); void uwu_name(); void truncate_name(char *); void remove_brackets(char *); @@ -154,6 +155,7 @@ int main(int argc, char *argv[]) print_ascii(); else if (ascii_image_flag == 1) print_image(); + uwu_kernel(); uwu_name(); print_info(); } @@ -889,6 +891,31 @@ void usage(char *arg) arg, BLUE, NORMAL); } +void uwu_kernel() +{ + #define KERNEL_TO_UWU(str, original, uwufied) \ + if (strcmp(str, original) == 0) \ + sprintf(str, "%s", uwufied) + + char *temp_kernel = kernel; + char *token; + char splitted[16][128] = {}; + + int count = 0; + while((token = strsep(&temp_kernel, " "))) { + strcpy(splitted[count], token); + count++; + } + strcpy(kernel, ""); + for(int i = 0;i < 16;i++) { + KERNEL_TO_UWU(splitted[i], "Linux", "Linuwu"); + KERNEL_TO_UWU(splitted[i], "linux", "linuwu"); + if(i != 0) strcat(kernel, " "); + strcat(kernel, splitted[i]); + } + #undef KERNEL_TO_UWU +} + void uwu_name() { // uwufies distro name