New output for -l opt, new gentowo image and new -c command, to choose a custom image.
This commit is contained in:
parent
609f7f7669
commit
c53e374e15
4 changed files with 38 additions and 17 deletions
|
@ -4,7 +4,7 @@ A meme system info tool for (almost) all your Linux/Unix-based systems, based on
|
||||||
|
|
||||||
## Currently supported distros
|
## Currently supported distros
|
||||||
|
|
||||||
Nyarch Linuwu, Nyartix Linuwu, Debinyan, Fedowa, GentOwO, Myanjawo, and UwUntu; Plus Nyandroid; and FweeBSD, and OwOpenBSD.
|
Nyarch Linuwu, Nyartix Linuwu, Debinyan, Fedowa, GentOwO, Miwint, Myanjawo, Pop OwOs, UwUntu, and Void; Plus Nyandroid; and FweeBSD, and OwOpenBSD.
|
||||||
|
|
||||||
## Building and installation
|
## Building and installation
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ Images are working in almost every terminal, for a better experience i recommend
|
||||||
<img src="https://raw.githubusercontent.com/TheDarkBug/uwufetch/main/res/debian.png" title="" alt="image" width="200"> Debinyan by u/Ishaan_P ([here](https://www.reddit.com/r/linuxmasterrace/comments/lxqip4/debinyan/))
|
<img src="https://raw.githubusercontent.com/TheDarkBug/uwufetch/main/res/debian.png" title="" alt="image" width="200"> Debinyan by u/Ishaan_P ([here](https://www.reddit.com/r/linuxmasterrace/comments/lxqip4/debinyan/))
|
||||||
<img src="https://raw.githubusercontent.com/TheDarkBug/uwufetch/main/res/endeavour.png" title="" alt="image" width="200"> Endowo Os by u/zuru2003 ([here](https://www.reddit.com/r/linuxmasterrace/comments/ly9zed/endowo_os/))
|
<img src="https://raw.githubusercontent.com/TheDarkBug/uwufetch/main/res/endeavour.png" title="" alt="image" width="200"> Endowo Os by u/zuru2003 ([here](https://www.reddit.com/r/linuxmasterrace/comments/ly9zed/endowo_os/))
|
||||||
<img src="https://raw.githubusercontent.com/TheDarkBug/uwufetch/main/res/fedora.png" title="" alt="image" width="200"> Fedowa by u/iD3nis124 ([here](https://www.reddit.com/r/linuxmasterrace/comments/lxjp3s/saw_nyarch_and_had_to_do_fedowa/))
|
<img src="https://raw.githubusercontent.com/TheDarkBug/uwufetch/main/res/fedora.png" title="" alt="image" width="200"> Fedowa by u/iD3nis124 ([here](https://www.reddit.com/r/linuxmasterrace/comments/lxjp3s/saw_nyarch_and_had_to_do_fedowa/))
|
||||||
<img src="https://raw.githubusercontent.com/TheDarkBug/uwufetch/main/res/gentoo.png" title="" alt="image" width="200"> GentOwO by u/Abbix57 ([here](https://www.reddit.com/r/linuxmasterrace/comments/lyeija/gentowo/))
|
<img src="https://raw.githubusercontent.com/TheDarkBug/uwufetch/main/res/gentoo.png" title="" alt="image" width="200"> GentOwO by u/TheSatisfiedPig ([here](https://www.reddit.com/r/linuxmasterrace/comments/m11aml/genchu/))
|
||||||
<img src="https://raw.githubusercontent.com/TheDarkBug/uwufetch/main/res/manjaro.png" title="" alt="image" width="200"> Myanjawo by u/matrixrunner ([here](https://www.reddit.com/r/linuxmasterrace/comments/lxx9h7/myanjawo_also_in_wallpaper/))
|
<img src="https://raw.githubusercontent.com/TheDarkBug/uwufetch/main/res/manjaro.png" title="" alt="image" width="200"> Myanjawo by u/matrixrunner ([here](https://www.reddit.com/r/linuxmasterrace/comments/lxx9h7/myanjawo_also_in_wallpaper/))
|
||||||
<img src="https://raw.githubusercontent.com/TheDarkBug/uwufetch/main/res/linuxmint.png" title="" alt="image" width="200"> Miwint by u/iD3nis124 ([here](https://www.reddit.com/r/linuxmasterrace/comments/ly8oy0/seen_a_lot_of_people_asking_for_mint_so_here_it_is/))
|
<img src="https://raw.githubusercontent.com/TheDarkBug/uwufetch/main/res/linuxmint.png" title="" alt="image" width="200"> Miwint by u/iD3nis124 ([here](https://www.reddit.com/r/linuxmasterrace/comments/ly8oy0/seen_a_lot_of_people_asking_for_mint_so_here_it_is/))
|
||||||
<img src="https://raw.githubusercontent.com/TheDarkBug/uwufetch/main/res/neon.png" title="" alt="image" width="200"> KDE Uwon by u/muff2 ([here](https://www.reddit.com/r/linuxmasterrace/comments/lxt82v/kde_uwon/))
|
<img src="https://raw.githubusercontent.com/TheDarkBug/uwufetch/main/res/neon.png" title="" alt="image" width="200"> KDE Uwon by u/muff2 ([here](https://www.reddit.com/r/linuxmasterrace/comments/lxt82v/kde_uwon/))
|
||||||
|
|
BIN
res/gentoo.png
BIN
res/gentoo.png
Binary file not shown.
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 381 KiB |
47
uwufetch.c
47
uwufetch.c
|
@ -40,7 +40,7 @@ struct rusage r_usage;
|
||||||
struct utsname sys_var;
|
struct utsname sys_var;
|
||||||
struct sysinfo sys;
|
struct sysinfo sys;
|
||||||
int ram_max, pkgs, a_i_flag = 0;
|
int ram_max, pkgs, a_i_flag = 0;
|
||||||
char user[32], host[253], shell[64], version_name[64], cpu_model[256], pkgman_name[64];
|
char user[32], host[253], shell[64], version_name[64], cpu_model[256], pkgman_name[64], image_name[32];
|
||||||
int pkgman();
|
int pkgman();
|
||||||
void get_info();
|
void get_info();
|
||||||
void list();
|
void list();
|
||||||
|
@ -53,11 +53,15 @@ void uwu_name();
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
int opt = 0;
|
int opt = 0;
|
||||||
get_info();
|
get_info();
|
||||||
while((opt = getopt(argc, argv, "ad:hil")) != -1) {
|
while((opt = getopt(argc, argv, "ad:hilc:")) != -1) {
|
||||||
switch(opt) {
|
switch(opt) {
|
||||||
case 'a':
|
case 'a':
|
||||||
a_i_flag = 0;
|
a_i_flag = 0;
|
||||||
break;
|
break;
|
||||||
|
case 'c':
|
||||||
|
a_i_flag = 1;
|
||||||
|
sprintf(image_name, "%s", optarg);
|
||||||
|
break;
|
||||||
case 'd':
|
case 'd':
|
||||||
if (optarg) sprintf(version_name, "%s", optarg);
|
if (optarg) sprintf(version_name, "%s", optarg);
|
||||||
break;
|
break;
|
||||||
|
@ -140,7 +144,7 @@ void get_info() { // get all necessary info
|
||||||
closedir(system_app);
|
closedir(system_app);
|
||||||
closedir(system_priv_app);
|
closedir(system_priv_app);
|
||||||
sprintf(version_name, "android");
|
sprintf(version_name, "android");
|
||||||
} else sprintf(version_name, "generic");
|
} else sprintf(version_name, "unknown");
|
||||||
}
|
}
|
||||||
// user name, host name and shell
|
// user name, host name and shell
|
||||||
if (strcmp(version_name, "android") != 0) {
|
if (strcmp(version_name, "android") != 0) {
|
||||||
|
@ -163,8 +167,8 @@ void get_info() { // get all necessary info
|
||||||
memmove(&shell[0], &shell[5], 16);
|
memmove(&shell[0], &shell[5], 16);
|
||||||
|
|
||||||
// system info
|
// system info
|
||||||
if (uname(&sys_var) == -1) printf("There was some kind of error while getting the username\n");
|
uname(&sys_var);
|
||||||
if (sysinfo(&sys) == -1) printf("There was some kind of error while getting system info\n");
|
sysinfo(&sys);
|
||||||
|
|
||||||
// ram
|
// ram
|
||||||
ram_max = sys.totalram * sys.mem_unit / 1048576;
|
ram_max = sys.totalram * sys.mem_unit / 1048576;
|
||||||
|
@ -173,10 +177,24 @@ void get_info() { // get all necessary info
|
||||||
}
|
}
|
||||||
|
|
||||||
void list(char* arg) { // prints distribution list
|
void list(char* arg) { // prints distribution list
|
||||||
|
/* distributions are listed by distribution branch
|
||||||
|
to make the output easier to understand by the user,
|
||||||
|
also i didn't like the previous listing.*/
|
||||||
printf( "%s -d <options>\n"
|
printf( "%s -d <options>\n"
|
||||||
" Available distributions:\n"
|
" Available distributions:\n"
|
||||||
"%s%sarch, artix, %sdebian, %subuntu, %sfedora, %sgentoo, %smanjaro, \"manjaro-arm\", android, %sopenbsd, %sfreebsd%s\n",
|
" %sArch linux %sbased:\n"
|
||||||
arg, BOLD, BLUE, RED, PINK, CYAN, MAGENTA, GREEN, YELLOW, RED, NORMAL);
|
" %sarch, artix, %smanjaro, \"manjaro-arm\"\n\n"
|
||||||
|
" %sDebian/%sUbuntu %sbased:\n"
|
||||||
|
" %sdebian, %slinuxmint, %spopos\n\n"
|
||||||
|
" %sOther/spare distributions:\n"
|
||||||
|
" %sfedora, %sgentoo, %svoid, android, %sunknown\n\n"
|
||||||
|
" %sBSD:\n"
|
||||||
|
" freebsd, %sopenbsd\n",
|
||||||
|
arg, BLUE, NORMAL, BLUE, GREEN, // Arch based colors
|
||||||
|
RED, YELLOW, NORMAL, RED, GREEN, BLUE, // Debian based colors
|
||||||
|
NORMAL, BLUE, PINK, GREEN, WHITE, // Other/spare distributions colors
|
||||||
|
RED, YELLOW // BSD colors
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void print_ascii() { // prints logo (as ascii art) of the given system. distributions listed alphabetically.
|
void print_ascii() { // prints logo (as ascii art) of the given system. distributions listed alphabetically.
|
||||||
|
@ -278,7 +296,7 @@ void print_ascii() { // prints logo (as ascii art) of the given system. distribu
|
||||||
|
|
||||||
// BSD
|
// BSD
|
||||||
|
|
||||||
else if (strcmp(version_name, "freebsd") == -1) {
|
else if (strcmp(version_name, "freebsd") == 0) {
|
||||||
printf( "\032[1E\033[3C%s\n"
|
printf( "\032[1E\033[3C%s\n"
|
||||||
" /\\,-'''''-,/\\\n"
|
" /\\,-'''''-,/\\\n"
|
||||||
" \\_) (_/\n"
|
" \\_) (_/\n"
|
||||||
|
@ -301,7 +319,8 @@ void print_ascii() { // prints logo (as ascii art) of the given system. distribu
|
||||||
|
|
||||||
void print_image() { // prints logo (as an image) of the given system. distributions listed alphabetically.
|
void print_image() { // prints logo (as an image) of the given system. distributions listed alphabetically.
|
||||||
char command[256];
|
char command[256];
|
||||||
sprintf(command, "viu -t -w 18 -h 8 /usr/lib/uwufetch/%s.png 2> /dev/null", version_name);
|
if (strlen(image_name) > 1) sprintf(command, "viu -t -w 18 -h 8 %s 2> /dev/null", image_name);
|
||||||
|
else sprintf(command, "viu -t -w 18 -h 8 /usr/lib/uwufetch/%s.png 2> /dev/null", version_name);
|
||||||
if (system(command) != 0) { // if viu is not installed
|
if (system(command) != 0) { // if viu is not installed
|
||||||
printf( "\033[1E\033[3C%s\n"
|
printf( "\033[1E\033[3C%s\n"
|
||||||
" There was an\n"
|
" There was an\n"
|
||||||
|
@ -316,15 +335,17 @@ void print_image() { // prints logo (as an image) of the given system. distribut
|
||||||
void usage(char* arg) {
|
void usage(char* arg) {
|
||||||
printf("Usage: %s <args>\n"
|
printf("Usage: %s <args>\n"
|
||||||
" -a, --ascii prints logo as ascii text (default)\n"
|
" -a, --ascii prints logo as ascii text (default)\n"
|
||||||
" -d, --distro %slets you choose the logo to print%s\n"
|
" -c, --custom choose a custom image\n"
|
||||||
|
" -d, --distro lets you choose the logo to print\n"
|
||||||
" -h, --help prints this help page\n"
|
" -h, --help prints this help page\n"
|
||||||
" -i, --image prints logo as image\n"
|
" -i, --image prints logo as image\n"
|
||||||
" %sworks in few terminals\n"
|
" %sworks in most terminals\n"
|
||||||
" <cat res/IMAGES.md> for more info%s\n",
|
" read res/IMAGES.md for more info%s\n",
|
||||||
arg, YELLOW, NORMAL, BLUE, NORMAL);
|
arg, BLUE, NORMAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void uwu_name() { // changes distro name to uwufied(?) name
|
void uwu_name() { // changes distro name to uwufied(?) name
|
||||||
|
|
||||||
// linux
|
// linux
|
||||||
if (strcmp(version_name, "arch") == 0) sprintf(version_name, "%s", "Nyarch Linuwu");
|
if (strcmp(version_name, "arch") == 0) sprintf(version_name, "%s", "Nyarch Linuwu");
|
||||||
else if (strcmp(version_name, "artix") == 0) sprintf(version_name, "%s", "Nyartix Linuwu");
|
else if (strcmp(version_name, "artix") == 0) sprintf(version_name, "%s", "Nyartix Linuwu");
|
||||||
|
|
Loading…
Reference in a new issue