From 62568c0c367024e89b16ba35f1825e58d551e49d Mon Sep 17 00:00:00 2001 From: PoorPockets McNewHold Date: Sun, 26 Dec 2021 15:32:21 +0100 Subject: [PATCH] Added comment and instruction on how to bypass the Model OEM line display, to fix the missing OEM error. --- README.md | 18 ++++++++++++++++++ uwufetch.c | 7 ++++--- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a890d84..18a433f 100644 --- a/README.md +++ b/README.md @@ -83,6 +83,24 @@ First of all, you will need `viu`, which you can install by following the [guide `viu` supports [kitty](https://github.com/kovidgoyal/kitty) and [iTerm](https://iterm2.com/)'s image protocols. If not supported by the current terminal, `viu` uses the fallback Unicode half-block mode (images will look "blocky"), that is the case in many terminal emulators (gnome-terminal, Konsole, etc.). See also: [viu's README](https://github.com/atanunq/viu#description). +## Issues + +### `MOWODEL` showing `To Be Filled By O.E.M.` + +This happen when your computer hasn't had any [OEM info filled in](https://www.investopedia.com/terms/o/oem.asp) (Habitually, by the original company you could have buy your preconfigured computer from, or from which company prepared it). +While you could fill it yourself with your own custom info too, you can also disable the part of uwufetch which display this line. +Edit [`uwufetch.c`](https://github.com/TheDarkBug/uwufetch/blob/main/uwufetch.c) and search for the line `if (config_flags->show_host)`. +Once found, simply comment it out using `//` until the next `if` statement. +For example : +```C +// if (config_flags->show_host) +// responsively_printf(print_buf, "%s%s%sMOWODEL %s%s", +// MOVE_CURSOR, NORMAL, BOLD, NORMAL, +// user_info->model); + if (config_flags->show_kernel) +``` +Then, build your edited uwufetch executable as normal. + ### For copyright and logos info See [COPYRIGHT.md](/res/COPYRIGHT.md). diff --git a/uwufetch.c b/uwufetch.c index 008e314..fb31e1d 100644 --- a/uwufetch.c +++ b/uwufetch.c @@ -436,6 +436,7 @@ void print_info(struct configuration* config_flags, struct info* user_info) { responsively_printf(print_buf, "%s%s%sOWOS %s%s", MOVE_CURSOR, NORMAL, BOLD, NORMAL, user_info->os_name); + // Comment this section, to get rid of the ¨To Be Filled By O.E.M.¨ text, if your computer hasn't had any OEM distributor filled in. if (config_flags->show_host) responsively_printf(print_buf, "%s%s%sMOWODEL %s%s", MOVE_CURSOR, NORMAL, BOLD, NORMAL, @@ -977,9 +978,9 @@ struct info get_info() sprintf(user_info.user, "unknown"); fclose(whoami); // model name - model_fp = popen("getprop ro.product.model", "r"); - while (fgets(buffer, sizeof(buffer), model_fp) && !sscanf(buffer, "%[^\n]", user_info.model)) - ; + //model_fp = popen("getprop ro.product.model", "r"); + //while (fgets(buffer, sizeof(buffer), model_fp) && !sscanf(buffer, "%[^\n]", user_info.model)) + // ; #ifndef __FREEBSD__ while (fgets(buffer, sizeof(buffer), cpuinfo) && !sscanf(buffer, "Hardware : %[^\n]", user_info.cpu_model)) ;