This commit is contained in:
TheDarkBug 2021-11-28 14:02:51 +01:00
parent 445e8e260e
commit 5be84cd1b6
4 changed files with 7 additions and 8 deletions

View file

@ -1 +0,0 @@
uwufetch_man.md

View file

@ -30,7 +30,7 @@ build: $(FILES)
debug: debug:
$(CC) $(CFLAGS_DEBUG) -o $(NAME) $(FILES) $(CC) $(CFLAGS_DEBUG) -o $(NAME) $(FILES)
./$(NAME) ./$(NAME) -d amogos
install: install:
mkdir -p $(DESTDIR)$(PREFIX) $(DESTDIR)$(LIBDIR)/uwufetch $(DESTDIR)$(MANDIR) mkdir -p $(DESTDIR)$(PREFIX) $(DESTDIR)$(LIBDIR)/uwufetch $(DESTDIR)$(MANDIR)

View file

@ -706,11 +706,11 @@ struct info get_info()
#else #else
FILE *cpuinfo = popen("sysctl -a | egrep -i 'hw.model'", "r"); FILE *cpuinfo = popen("sysctl -a | egrep -i 'hw.model'", "r");
#endif #endif
FILE *host_model_info = fopen("/etc/hostname", "r"); // try open /etc/hostname first FILE *host_model_info = fopen("/sys/devices/virtual/dmi/id/board_name", "r"); // try to get board name ("HOWOST" INFO NAME SHOULD BE CHANGED AS IT IS NOT MEANT TO BE THE hostname, BUT THE MODEL OF THE COMPUTER)
if (!host_model_info) if (!host_model_info)
host_model_info = fopen("/sys/devices/virtual/dmi/id/board_name", "r"); // if couldn't then try another host_model_info = fopen("/sys/devices/virtual/dmi/id/product_name", "r"); // if couldn't then try another
if (!host_model_info) // if failed if (!host_model_info) // if failed
host_model_info = fopen("/sys/devices/virtual/dmi/id/product_name", "r"); // etc. host_model_info = fopen("/etc/hostname", "r"); // etc.
if (host_model_info) if (host_model_info)
{ // if succeeded to open one of the file { // if succeeded to open one of the file
fgets(line, 256, host_model_info); fgets(line, 256, host_model_info);
@ -751,7 +751,7 @@ struct info get_info()
break; break;
// trying to detect amogos because in its os-release file ID value is just "debian" // trying to detect amogos because in its os-release file ID value is just "debian"
if (strcmp(user_info.version_name, "debian") == 0) if (strcmp(user_info.version_name, "debian") == 0 || strcmp(user_info.version_name, "raspbian") == 0) // will be removed when amogos will have an os-release file with ID=amogos
{ {
DIR *amogos_plymouth = opendir("/usr/share/plymouth/themes/amogos"); DIR *amogos_plymouth = opendir("/usr/share/plymouth/themes/amogos");
if (amogos_plymouth) if (amogos_plymouth)