parent
445e8e260e
commit
5be84cd1b6
4 changed files with 7 additions and 8 deletions
|
@ -1 +0,0 @@
|
||||||
uwufetch_man.md
|
|
2
Makefile
2
Makefile
|
@ -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)
|
||||||
|
|
|
@ -6,4 +6,4 @@
|
||||||
{BACKGROUND_WHITE} {BACKGROUND_RED} {NORMAL}
|
{BACKGROUND_WHITE} {BACKGROUND_RED} {NORMAL}
|
||||||
{BACKGROUND_WHITE} {BACKGROUND_RED} {NORMAL}
|
{BACKGROUND_WHITE} {BACKGROUND_RED} {NORMAL}
|
||||||
{BACKGROUND_RED} {NORMAL} {BACKGROUND_RED} {NORMAL}
|
{BACKGROUND_RED} {NORMAL} {BACKGROUND_RED} {NORMAL}
|
||||||
{BACKGROUND_RED} {NORMAL} {BACKGROUND_RED} {NORMAL}
|
{BACKGROUND_RED} {NORMAL} {BACKGROUND_RED} {NORMAL}
|
||||||
|
|
10
uwufetch.c
10
uwufetch.c
|
@ -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)
|
||||||
|
@ -1232,7 +1232,7 @@ void print_image(struct info *user_info)
|
||||||
RED);
|
RED);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
// unfortunately, the iOS stdlib does not have system();
|
// unfortunately, the iOS stdlib does not have system();
|
||||||
// because it reports that it is not available under iOS during compilation
|
// because it reports that it is not available under iOS during compilation
|
||||||
printf("\033[0E\033[3C%s\n"
|
printf("\033[0E\033[3C%s\n"
|
||||||
" There was an\n"
|
" There was an\n"
|
||||||
|
|
Loading…
Reference in a new issue