From 976e8e8b36c0e1f714c1384cc399c218864f39f4 Mon Sep 17 00:00:00 2001 From: kugiyasan Date: Sat, 6 Mar 2021 21:58:19 -0500 Subject: [PATCH] Rewrote bash commands to shell commands --- uwufetch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/uwufetch.c b/uwufetch.c index 55bb0ff..94e0af9 100644 --- a/uwufetch.c +++ b/uwufetch.c @@ -110,7 +110,7 @@ void get_info() { // get all necessary info memmove(&shell[0], &shell[5], 16); // os version - FILE *fos_rel = popen("cut -d '=' -f2 <<< $(cat /etc/os-release | grep ID=) 2> /dev/null", "r"); + FILE *fos_rel = popen("cat /etc/os-release | grep ID= | cut -d '=' -f2 2> /dev/null", "r"); fscanf(fos_rel,"%[^\n]", version_name); fclose(fos_rel); @@ -118,7 +118,7 @@ void get_info() { // get all necessary info if (sysinfo(&sys) == -1) printf("There was some kind of error while getting system info\n"); // cpu and ram - FILE *fcpu = popen("sed 's/ //g' <<< $(cut -d ':' -f2 <<< $(lscpu | grep 'Model name:')) 2> /dev/null", "r"); + 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_max = sys.totalram * sys.mem_unit / 1048576;