From 7efaabfb8b2e03b3d0b57e1308537f53558f33c3 Mon Sep 17 00:00:00 2001 From: TheDarkBug Date: Sun, 7 Mar 2021 22:04:05 +0100 Subject: [PATCH] Fixed info printing with image mode, added (partial) termux support --- Makefile | 15 ++++++++--- res/IMAGES.md | 1 + res/android.png | Bin 0 -> 20975 bytes uwufetch.c | 69 +++++++++++++++++++++++++++++++++--------------- 4 files changed, 61 insertions(+), 24 deletions(-) create mode 100644 res/android.png diff --git a/Makefile b/Makefile index eac15aa..4919a5d 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,10 @@ all: build install build: uwufetch.c gcc $(FLAGS) -o $(NAME) $(FILES) +debug: build install + clear + ./uwufetch + install: sudo cp $(NAME) $(INSTALL_DIR)$(NAME) ls /usr/lib/uwufetch/ > /dev/null || sudo mkdir /usr/lib/uwufetch/ @@ -16,6 +20,11 @@ uninstall: sudo rm $(INSTALL_DIR)$(NAME) sudo rm -rf /usr/lib/uwufetch/ -debug: build install - clear - ./uwufetch \ No newline at end of file +termux: build + cp $(NAME) /data/data/com.termux/files$(INSTALL_DIR)$(NAME) + ls /data/data/com.termux/files/usr/lib/uwufetch/ > /dev/null || mkdir /data/data/com.termux/files/usr/lib/uwufetch/ + cp res/* /data/data/com.termux/files/usr/lib/uwufetch/ + +termux_uninstall: + rm -rf /data/data/com.termux/files$(INSTALL_DIR)$(NAME) + rm -rf /data/data/com.termux/files/usr/lib/uwufetch/ \ No newline at end of file diff --git a/res/IMAGES.md b/res/IMAGES.md index 50bd0a6..97f2656 100644 --- a/res/IMAGES.md +++ b/res/IMAGES.md @@ -22,3 +22,4 @@ If you want to remove *your* image from this repository contact me on [reddit](h image Tuwu by u/Annual-Examination96 ([here](https://www.reddit.com/r/linuxmasterrace/comments/lz2i32/tuwu/)) image Uwuntu by u/Chicki2D ([here](https://www.reddit.com/r/linuxmasterrace/comments/lwsnul/uwuntu/)) image Owoid by u/Satoqz ([here](https://www.reddit.com/r/linuxmasterrace/comments/lxnjwd/my_boyfriend_decided_to_create_owoid/)) +image Nyandroid by u/6b86b3ac03c167320d93 ([here](https://www.reddit.com/r/linuxmasterrace/comments/lye15q/im_not_an_artist_but_heres_my_attempt_at_making/)) (android at the end because it could be not considered as an actual distribution of gnu/linux) diff --git a/res/android.png b/res/android.png new file mode 100644 index 0000000000000000000000000000000000000000..ae856420aa5248b5556dbab61974ab8d1f8382fb GIT binary patch literal 20975 zcmeEu^;guE44tAPNX<|J5=x1{&^43-0+KSs z&>$c+bTiaDgWr4KKXBK2>#cS5hgp2i`Rva*d+)P*pHS^bDp$xD$siEO6*bidx)2EQ zCImuq`QioeM957M0e;TeC}=7`AjMJSN9O0j-|UvEx|$G(HxC37_yz*OgGYf25D5G( z1hVuD0)c*nK zwFe4MJV#c>y*`>e4LaG_8~bKTU2>BvX!Vh5CPYVa%|zG(^f~u%aXk#~o=pVWN(^ zGpH?+S5X|4^5xyAy~k_XsOm6yG1lbp~R|M_3rxC1-@~iN%cP0yJIuAlJWhoolEu5sdQ8- zeP(1T)*3s;h68iYs#Gu)voZEgB*+gOlw3n7j^q5cFDXLCUxrJ%>g-roR;RL2 z-Rw)6XT8pgubUVmN#hf|ZR}z{LzGavFCUNE$CDsV~? z(TI;ZAILRO{^s-=ueW?P{{~X@S2jAp%&w^nCrQjJZE6+t=9^QhYoygFUr$K24AWv~ z)=X0uYM#96uJu6q^|;=_G<7H#N*XnwHl6dXhma8#`MZBEFC;#9OG&M1%kK_nofV1S zx8mEr?K`zW_md{v4)*hZotQeA=n79lb;aSlX<9_cw*_MI#BrnDg}D&0zI;&~1S`re zaqB#G>jGI;y=`|{{x8|g##m3a+da1rS-?|m0~#-O+x&1bXw7#Oeu=@8FZGf~e{?zu z1)YznAYPW%OUZMc$l?!N5w{nLBf3A8ERB$1DTx9b&F!v4-<3jrDjplyC@8yQ?MCMD z^+9pshQ+dp=>fW&= znr+{X`||^q<=y5Snh+UcP~%rq4jMETHgn>n2#kz>}9R$mEi*l$jt8 z%eh(Rpd^8ff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`8^U>iD0iQGt@9oNq1YUB}Rzq8eun7|DbaBK`P+#q3^_^#7pf(eo>ZszBfyLePx z46UZKw2v!$FnH(5h=Bc=+))iqjR5qg!13 zp!WzC6(oPWeCnb8KM^VjOMfsdJk^)zZQh z;LNPiX9!>!TtuTl;@U+N!H?pceJwV!1Ojl|7nE27J@UgcUKw6jBZ~JLhQDLJ74HR6 zy-0ZNW1DzQcXW)`(DcWUh%Yu=pj2>M|2C!%R7}Y`Y0naQw#LVvXd>Y$8I!s{CQVe@ z-V!K}OnsG-kv7OrPe&*K`_Cr`*Mq>-w9wtXT7{b9a^5ZQ_a?={0WK+@(@wY^pKD+y zRs|7hh@fGj9J>2=!x5Ta^z+`R&IFCpE{|7j9S_-SGeT`v9q_WJvaThcB+jlqHOqgE z13S$k90kKJkCY4`K<)q2o)96GwlnJhf4X!iIv^Gg!9Z_a!fU8e)q? zJ}jz>)$~=J{w&NvKh4=UH9oQC91xJ5!hET^K^HhH44P8qAAw7?;w4KXmhY(D`aio~ zc<!n{la=rSH_s$PaP`{R0 z!wPtu9{X7KcCS*^?+OB^k2j+A-M?)frjjojH; z56<<6xbv$e>es~kX3wh*QLw&yqV9xOyF_No)V5~{FMv~Lr(RShfAvV&`e28Y?U7=} z1rdMi #include #include #include @@ -21,7 +22,7 @@ struct rusage r_usage; struct utsname sys_var; struct sysinfo sys; -int ram_max, pkgs; +int ram_max, pkgs, a_i_flag = 0; char user[32], host[253], shell[64], version_name[64], cpu_model[256], pkgman_name[64]; int pkgman(); void get_info(); @@ -31,10 +32,8 @@ void print_image(); void usage(char*); int main(int argc, char *argv[]) { - int opt = 0, a_i_flag = 0; + int opt = 0; get_info(); - //sprintf(version_name, "%s", "debian"); // a debug thing - while((opt = getopt(argc, argv, "ad:hi")) != -1) { switch(opt) { case 'a': @@ -94,7 +93,10 @@ int pkgman() { // this is just a function that returns the total of installed pa } void print_info() { // print collected info - printf("\033[9A\033[17C %s%s%s@%s\n", NORMAL, BOLD, user, host); + char *start_cursor_position = "\033[9A\033[18C"; + //if (a_i_flag) start_cursor_position = "\033[8A\033[18C"; // this if - else is for a little bug + //else start_cursor_position = "\033[9A\033[18C"; + printf("%s%s%s%s@%s\n", start_cursor_position, NORMAL, BOLD, user, host); printf("\033[17C %s%sOWOS %s%s\n", NORMAL, BOLD, NORMAL, version_name); printf("\033[17C %s%sKERNEL %s%s %s\n", NORMAL, BOLD, NORMAL, sys_var.release, sys_var.machine); printf("\033[17C %s%sCPUWU %s%s\n", NORMAL, BOLD, NORMAL, cpu_model); @@ -106,26 +108,45 @@ void print_info() { // print collected info } void get_info() { // get all necessary info + // os version + FILE *fos_rel = popen("cat /etc/os-release 2> /dev/null | awk '/^ID=/' | awk -F '=' '{print $2}'", "r"); + fscanf(fos_rel,"%[^\n]", version_name); + fclose(fos_rel); + if (strlen(version_name) < 1) { // handling unknown distribution + DIR *system_app = opendir("/system/app/"); + DIR *system_priv_app = opendir("/system/priv-app/"); + if (system_app && system_priv_app) { // android + closedir(system_app); + closedir(system_priv_app); + sprintf(version_name, "android"); + } else sprintf(version_name, "generic"); + } // user name, host name and shell - snprintf(user, 32, "%s", getenv("USER")); + if (strcmp(version_name, "android") != 0) { + snprintf(user, 32, "%s", getenv("USER")); + // cpu (this is here and not near the ram for efficiency) + FILE *fcpu = popen("lscpu | grep 'Model name:' | cut -d ':' -f2 | sed 's/ //g' 2> /dev/null", "r"); + fscanf(fcpu, "%[^\n]", cpu_model); + fclose(fcpu); + } + else if (strcmp(version_name, "android") == 0) { // android vars + FILE *whoami = popen("whoami", "r"); + fscanf(whoami, "%s", user); + fclose(whoami); + FILE *fcpu = popen("cat /proc/cpuinfo | grep 'Hardware' | cut -d ':' -f2 | sed 's/ //g' 2> /dev/null", "r"); + fscanf(fcpu, "%[^\n]", cpu_model); + fclose(fcpu); + } gethostname(host, 253); snprintf(shell, 16, "%s", getenv("SHELL")); memmove(&shell[0], &shell[5], 16); - // os version - FILE *fos_rel = popen("cat /etc/os-release | awk '/^ID=/' | awk -F '=' '{print $2}' 2> /dev/null", "r"); - fscanf(fos_rel,"%[^\n]", version_name); - fclose(fos_rel); - // system info if (uname(&sys_var) == -1) printf("There was some kind of error while getting the username\n"); if (sysinfo(&sys) == -1) printf("There was some kind of error while getting system info\n"); - // cpu and ram - FILE *fcpu = popen("lscpu | grep 'Model name:' | cut -d ':' -f2 | sed 's/ //g' 2> /dev/null", "r"); - fscanf(fcpu, "%[^\n]", cpu_model); - fclose(fcpu); + // ram ram_max = sys.totalram * sys.mem_unit / 1048576; getrusage(RUSAGE_SELF, &r_usage); pkgs = pkgman(); @@ -187,7 +208,7 @@ void print_ascii() { // prints logo (as ascii art) of the given system. distribu " \e[0;42m \e[0m \e[0;42m \e[0m \e[0;42m \e[0m\n" " \e[0;42m \e[0m \e[0;42m \e[0m \e[0;42m \e[0m\n" " \e[0;42m \e[0m \e[0;42m \e[0m \e[0;42m \e[0m\n"); - } else if (strcmp(version_name, "\"manjaro-arm\"") == 0) { // we use \ to include the " as the ID on manjaro-arm returns "manjaro-arm" not just manjaro-arm. + } else if (strcmp(version_name, "\"manjaro-arm\"") == 0) { sprintf(version_name, "%s", "Myanjawo AWM"); printf( "\033[0E\033[1C\u25b3 \u25b3 \u25e0\u25e0\u25e0\u25e0\n" " \e[0;42m \e[0m \e[0;42m \e[0m\n" @@ -197,19 +218,25 @@ void print_ascii() { // prints logo (as ascii art) of the given system. distribu " \e[0;42m \e[0m \e[0;42m \e[0m \e[0;42m \e[0m\n" " \e[0;42m \e[0m \e[0;42m \e[0m \e[0;42m \e[0m\n" " \e[0;42m \e[0m \e[0;42m \e[0m \e[0;42m \e[0m\n"); + } else if (strcmp(version_name, "android") == 0) { // android at the end because it could be not considered as an actual distribution of gnu/linux + sprintf(version_name, "%s", "Nyandroid"); + printf( "\033[2E\033[1C ascii icon\n nedds to be\n added\n\n\n\n"); } } void print_image() { // prints logo (as an image) of the given system. distributions listed alphabetically. char command[256]; sprintf(command, "viu -t -w 18 -h 8 /usr/lib/uwufetch/%s.png", version_name); system(command); + printf("\033[1E\033[0C\b"); if (strcmp(version_name, "arch") == 0) sprintf(version_name, "%s", "Nyarch Linuwu"); - if (strcmp(version_name, "artix") == 0) sprintf(version_name, "%s", "Nyartix Linuwu"); - if (strcmp(version_name, "debian") == 0) sprintf(version_name, "%s", "Debinyan"); - if (strcmp(version_name, "fedora") == 0) sprintf(version_name, "%s", "Fedowa"); - if (strcmp(version_name, "gentoo") == 0) sprintf(version_name, "%s", "GentOwO"); - if (strcmp(version_name, "manjaro") == 0) sprintf(version_name, "%s", "Myanjawo"); + else if (strcmp(version_name, "artix") == 0) sprintf(version_name, "%s", "Nyartix Linuwu"); + else if (strcmp(version_name, "debian") == 0) sprintf(version_name, "%s", "Debinyan"); + else if (strcmp(version_name, "fedora") == 0) sprintf(version_name, "%s", "Fedowa"); + else if (strcmp(version_name, "gentoo") == 0) sprintf(version_name, "%s", "GentOwO"); + else if (strcmp(version_name, "manjaro") == 0) sprintf(version_name, "%s", "Myanjawo"); + else if (strcmp(version_name, "\"manjaro-arm\"") == 0) sprintf(version_name, "%s", "Myanjawo AWM"); + else if (strcmp(version_name, "android") == 0) sprintf(version_name, "%s", "Nyandroid"); // android at the end because it could be not considered as an actual distribution of gnu/linux } void usage(char* arg) {