Added AmogOwOS support
This commit is contained in:
parent
d61bd391bd
commit
3ecf05e4a1
4 changed files with 89 additions and 67 deletions
|
@ -10,7 +10,7 @@ Nyalpine, Nyarch Linuwu, ArcOwO, Nyartix Linuwu, Debinyan, endevaOwO, Fedowa, Ge
|
||||||
|
|
||||||
### Partial support (Either no ASCII art, or no image is provided)
|
### Partial support (Either no ASCII art, or no image is provided)
|
||||||
|
|
||||||
KDE NeOwOn, nixOwOs; Plus FweeBSD, OwOpenBSD and macOwOS; Plus WinyandOwOws.
|
AmogOwOS, KDE NeOwOn, nixOwOs; Plus FweeBSD, OwOpenBSD and macOwOS; Plus WinyandOwOws.
|
||||||
|
|
||||||
## Building and installation
|
## Building and installation
|
||||||
|
|
||||||
|
|
9
res/ascii/amogos.txt
Normal file
9
res/ascii/amogos.txt
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
|
||||||
|
{BACKGROUND_RED} {NORMAL}
|
||||||
|
{BACKGROUND_WHITE} {BACKGROUND_RED} {NORMAL} {BACKGROUND_RED} {NORMAL}
|
||||||
|
{BACKGROUND_WHITE} {BACKGROUND_RED} {NORMAL} {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}
|
|
@ -82,6 +82,7 @@ Unknown (tux logo) \fBunknown\fR
|
||||||
.TP
|
.TP
|
||||||
.SH IMAGE OR ASCII ONLY
|
.SH IMAGE OR ASCII ONLY
|
||||||
.EX
|
.EX
|
||||||
|
AmogOwOs \fBamogos\fR
|
||||||
KDE NeOwOn \fBneon\fR
|
KDE NeOwOn \fBneon\fR
|
||||||
nixOwOs \fBnixos\fR
|
nixOwOs \fBnixos\fR
|
||||||
FweeBSD \fBfreebsd\fR
|
FweeBSD \fBfreebsd\fR
|
||||||
|
|
68
uwufetch.c
68
uwufetch.c
|
@ -171,7 +171,8 @@ int main(int argc, char *argv[])
|
||||||
uwu_kernel();
|
uwu_kernel();
|
||||||
uwu_name();
|
uwu_name();
|
||||||
|
|
||||||
for (int i = 0; gpu_model[i][0]; i++) {
|
for (int i = 0; gpu_model[i][0]; i++)
|
||||||
|
{
|
||||||
uwu_hw(gpu_model[i]);
|
uwu_hw(gpu_model[i]);
|
||||||
}
|
}
|
||||||
uwu_hw(cpu_model);
|
uwu_hw(cpu_model);
|
||||||
|
@ -312,13 +313,13 @@ int uptime_mac()
|
||||||
int uptime_freebsd()
|
int uptime_freebsd()
|
||||||
{ // this code is from coreutils uptime: https://github.com/coreutils/coreutils/blob/master/src/uptime.c
|
{ // this code is from coreutils uptime: https://github.com/coreutils/coreutils/blob/master/src/uptime.c
|
||||||
int boot_time = 0;
|
int boot_time = 0;
|
||||||
static int request[2] = { CTL_KERN, KERN_BOOTTIME };
|
static int request[2] = {CTL_KERN, KERN_BOOTTIME};
|
||||||
struct timeval result;
|
struct timeval result;
|
||||||
size_t result_len = sizeof result;
|
size_t result_len = sizeof result;
|
||||||
|
|
||||||
if (sysctl (request, 2, &result, &result_len, NULL, 0) >= 0)
|
if (sysctl(request, 2, &result, &result_len, NULL, 0) >= 0)
|
||||||
boot_time = result.tv_sec;
|
boot_time = result.tv_sec;
|
||||||
int time_now = time (NULL);
|
int time_now = time(NULL);
|
||||||
return time_now - boot_time;
|
return time_now - boot_time;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -417,7 +418,8 @@ void get_info()
|
||||||
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("/sys/devices/virtual/dmi/id/board_name", "r");
|
FILE *host_model_info = fopen("/sys/devices/virtual/dmi/id/board_name", "r");
|
||||||
if (!host_model_info) host_model_info = fopen("/sys/devices/virtual/dmi/id/product_name", "r");
|
if (!host_model_info)
|
||||||
|
host_model_info = fopen("/sys/devices/virtual/dmi/id/product_name", "r");
|
||||||
#ifdef __FREEBSD__
|
#ifdef __FREEBSD__
|
||||||
host_model_info = popen("sysctl -a hw.hv_vendor", "r");
|
host_model_info = popen("sysctl -a hw.hv_vendor", "r");
|
||||||
while (fgets(line, sizeof(line), host_model_info))
|
while (fgets(line, sizeof(line), host_model_info))
|
||||||
|
@ -667,7 +669,7 @@ void list(char *arg)
|
||||||
" %sArch linux %sbased:\n"
|
" %sArch linux %sbased:\n"
|
||||||
" %sarch, arcolinux, %sartix, endeavouros %smanjaro, manjaro-arm\n\n"
|
" %sarch, arcolinux, %sartix, endeavouros %smanjaro, manjaro-arm\n\n"
|
||||||
" %sDebian/%sUbuntu %sbased:\n"
|
" %sDebian/%sUbuntu %sbased:\n"
|
||||||
" %sdebian, %slinuxmint, neon %spop, %sraspbian %subuntu\n\n"
|
" %samogos, debian, %slinuxmint, neon %spop, %sraspbian %subuntu\n\n"
|
||||||
" %sBSD %sbased:\n"
|
" %sBSD %sbased:\n"
|
||||||
" %sfreebsd, %sopenbsd, %sm%sa%sc%so%ss\n\n"
|
" %sfreebsd, %sopenbsd, %sm%sa%sc%so%ss\n\n"
|
||||||
" %sOther/spare distributions:\n"
|
" %sOther/spare distributions:\n"
|
||||||
|
@ -684,28 +686,32 @@ void list(char *arg)
|
||||||
replace("Hello World!", "World", "everyone")
|
replace("Hello World!", "World", "everyone")
|
||||||
This returns "Hello everyone!".
|
This returns "Hello everyone!".
|
||||||
*/
|
*/
|
||||||
void replace(char *original, char *search, char *replacer) {
|
void replace(char *original, char *search, char *replacer)
|
||||||
|
{
|
||||||
char buffer[1024];
|
char buffer[1024];
|
||||||
char *ch;
|
char *ch;
|
||||||
if(!(ch = strstr(original, search))) return;
|
if (!(ch = strstr(original, search)))
|
||||||
|
return;
|
||||||
|
|
||||||
strncpy(buffer, original, ch-original);
|
strncpy(buffer, original, ch - original);
|
||||||
buffer[ch-original] = 0;
|
buffer[ch - original] = 0;
|
||||||
sprintf(buffer+(ch - original), "%s%s", replacer, ch + strlen(search));
|
sprintf(buffer + (ch - original), "%s%s", replacer, ch + strlen(search));
|
||||||
|
|
||||||
original[0] = 0;
|
original[0] = 0;
|
||||||
strcpy(original, buffer);
|
strcpy(original, buffer);
|
||||||
return replace(original, search, replacer);
|
return replace(original, search, replacer);
|
||||||
}
|
}
|
||||||
|
|
||||||
void replace_ignorecase(char *original, char *search, char *replacer) {
|
void replace_ignorecase(char *original, char *search, char *replacer)
|
||||||
|
{
|
||||||
char buffer[1024];
|
char buffer[1024];
|
||||||
char *ch;
|
char *ch;
|
||||||
if(!(ch = strcasestr(original, search))) return;
|
if (!(ch = strcasestr(original, search)))
|
||||||
|
return;
|
||||||
|
|
||||||
strncpy(buffer, original, ch-original);
|
strncpy(buffer, original, ch - original);
|
||||||
buffer[ch-original] = 0;
|
buffer[ch - original] = 0;
|
||||||
sprintf(buffer+(ch - original), "%s%s", replacer, ch + strlen(search));
|
sprintf(buffer + (ch - original), "%s%s", replacer, ch + strlen(search));
|
||||||
|
|
||||||
original[0] = 0;
|
original[0] = 0;
|
||||||
strcpy(original, buffer);
|
strcpy(original, buffer);
|
||||||
|
@ -721,16 +727,22 @@ void print_ascii()
|
||||||
sprintf(ascii_file, "./res/ascii/%s.txt", version_name);
|
sprintf(ascii_file, "./res/ascii/%s.txt", version_name);
|
||||||
file = fopen(ascii_file, "r");
|
file = fopen(ascii_file, "r");
|
||||||
// Now tries to get file from normal directory
|
// Now tries to get file from normal directory
|
||||||
if(!file) {
|
if (!file)
|
||||||
if(strcmp(version_name, "android") == 0) {
|
{
|
||||||
|
if (strcmp(version_name, "android") == 0)
|
||||||
|
{
|
||||||
sprintf(ascii_file, "/data/data/com.termux/files/usr/lib/uwufetch/ascii/%s.txt", version_name);
|
sprintf(ascii_file, "/data/data/com.termux/files/usr/lib/uwufetch/ascii/%s.txt", version_name);
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
sprintf(ascii_file, "/usr/lib/uwufetch/ascii/%s.txt", version_name);
|
sprintf(ascii_file, "/usr/lib/uwufetch/ascii/%s.txt", version_name);
|
||||||
}
|
}
|
||||||
file = fopen(ascii_file, "r");
|
file = fopen(ascii_file, "r");
|
||||||
if(!file) {
|
if (!file)
|
||||||
|
{
|
||||||
// Prevent infinite loops
|
// Prevent infinite loops
|
||||||
if(strcmp(version_name, "unknown") == 0) {
|
if (strcmp(version_name, "unknown") == 0)
|
||||||
|
{
|
||||||
printf("No\nunknown\nascii\nfile\n\n\n\n");
|
printf("No\nunknown\nascii\nfile\n\n\n\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -739,7 +751,8 @@ void print_ascii()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
char line[256];
|
char line[256];
|
||||||
while(fgets(line, 256, file)) {
|
while (fgets(line, 256, file))
|
||||||
|
{
|
||||||
replace(line, "{NORMAL}", NORMAL);
|
replace(line, "{NORMAL}", NORMAL);
|
||||||
replace(line, "{BOLD}", BOLD);
|
replace(line, "{BOLD}", BOLD);
|
||||||
replace(line, "{BLACK}", BLACK);
|
replace(line, "{BLACK}", BLACK);
|
||||||
|
@ -752,8 +765,10 @@ void print_ascii()
|
||||||
replace(line, "{WHITE}", WHITE);
|
replace(line, "{WHITE}", WHITE);
|
||||||
replace(line, "{PINK}", PINK);
|
replace(line, "{PINK}", PINK);
|
||||||
replace(line, "{LPINK}", LPINK);
|
replace(line, "{LPINK}", LPINK);
|
||||||
// For manjaro
|
// For manjaro and amogos
|
||||||
replace(line, "{BACKGROUND_GREEN}", "\e[0;42m");
|
replace(line, "{BACKGROUND_GREEN}", "\e[0;42m");
|
||||||
|
replace(line, "{BACKGROUND_RED}", "\e[0;41m");
|
||||||
|
replace(line, "{BACKGROUND_WHITE}", "\e[0;47m");
|
||||||
printf("%s", line);
|
printf("%s", line);
|
||||||
}
|
}
|
||||||
// Always set color to NORMAL, so there's no need to do this in every ascii file.
|
// Always set color to NORMAL, so there's no need to do this in every ascii file.
|
||||||
|
@ -1009,11 +1024,6 @@ void print_ascii()
|
||||||
WHITE, YELLOW, WHITE, YELLOW, WHITE, YELLOW, WHITE, YELLOW);*/
|
WHITE, YELLOW, WHITE, YELLOW, WHITE, YELLOW, WHITE, YELLOW);*/
|
||||||
}
|
}
|
||||||
|
|
||||||
void print_unknown_ascii() {
|
|
||||||
printf("\n\n\n\n\nidk man\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
void print_image()
|
void print_image()
|
||||||
{ // prints logo (as an image) of the given system. distributions listed alphabetically.
|
{ // prints logo (as an image) of the given system. distributions listed alphabetically.
|
||||||
char command[256];
|
char command[256];
|
||||||
|
@ -1078,6 +1088,7 @@ void uwu_kernel()
|
||||||
KERNEL_TO_UWU(splitted[i], "Linux", "Linuwu");
|
KERNEL_TO_UWU(splitted[i], "Linux", "Linuwu");
|
||||||
else KERNEL_TO_UWU(splitted[i], "linux", "linuwu");
|
else KERNEL_TO_UWU(splitted[i], "linux", "linuwu");
|
||||||
else KERNEL_TO_UWU(splitted[i], "alpine", "Nyalpine");
|
else KERNEL_TO_UWU(splitted[i], "alpine", "Nyalpine");
|
||||||
|
else KERNEL_TO_UWU(splitted[i], "amogos", "AmogOwOS");
|
||||||
else KERNEL_TO_UWU(splitted[i], "arch", "Nyarch Linuwu");
|
else KERNEL_TO_UWU(splitted[i], "arch", "Nyarch Linuwu");
|
||||||
else KERNEL_TO_UWU(splitted[i], "artix", "Nyartix Linuwu");
|
else KERNEL_TO_UWU(splitted[i], "artix", "Nyartix Linuwu");
|
||||||
else KERNEL_TO_UWU(splitted[i], "debian", "Debinyan");
|
else KERNEL_TO_UWU(splitted[i], "debian", "Debinyan");
|
||||||
|
@ -1153,6 +1164,7 @@ void uwu_name()
|
||||||
|
|
||||||
// linux
|
// linux
|
||||||
STRING_TO_UWU("alpine", "Nyalpine");
|
STRING_TO_UWU("alpine", "Nyalpine");
|
||||||
|
else STRING_TO_UWU("amogos", "AmogOwOS");
|
||||||
else STRING_TO_UWU("arch", "Nyarch Linuwu");
|
else STRING_TO_UWU("arch", "Nyarch Linuwu");
|
||||||
else STRING_TO_UWU("arcolinux", "ArcOwO Linuwu");
|
else STRING_TO_UWU("arcolinux", "ArcOwO Linuwu");
|
||||||
else STRING_TO_UWU("artix", "Nyartix Linuwu");
|
else STRING_TO_UWU("artix", "Nyartix Linuwu");
|
||||||
|
|
Loading…
Reference in a new issue