Merge pull request #176 from PoorPocketsMcNewHold/main

Added comment and instruction on how to bypass the Model OEM line display, to fix the missing OEM error.
This commit is contained in:
TheDarkBug 2021-12-26 18:36:26 +01:00 committed by GitHub
commit d809032450
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 3 deletions

View file

@ -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).

View file

@ -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))
;