From 5a511a1f9e7e2a3bb89abdd33b3fe502bfd11ab8 Mon Sep 17 00:00:00 2001 From: LukeHuckman Date: Fri, 16 Apr 2021 16:32:00 +0800 Subject: [PATCH] Hide resolution by default on headless systems --- uwufetch.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/uwufetch.c b/uwufetch.c index f1caf1a..38afbee 100644 --- a/uwufetch.c +++ b/uwufetch.c @@ -245,8 +245,9 @@ void print_info() printf("\033[18C%s%sWAM %s%i MB/%i MB\n", NORMAL, BOLD, NORMAL, (ram_used), ram_total); if (show_resolution) - printf("\033[18C%s%sRESOLUTION%s %dx%d\n", - NORMAL, BOLD, NORMAL, screen_width, screen_height); + if (screen_width != 0 || screen_height != 0) + printf("\033[18C%s%sRESOLUTION%s %dx%d\n", + NORMAL, BOLD, NORMAL, screen_width, screen_height); if (show_shell) printf("\033[18C%s%sSHELL %s%s\n", NORMAL, BOLD, NORMAL, shell); @@ -254,7 +255,7 @@ void print_info() printf("\033[18C%s%sPKGS %s%s%d %s\n", NORMAL, BOLD, NORMAL, NORMAL, pkgs, pkgman_name); if (show_uptime) - if(sys.uptime/3600 < 24) + if (sys.uptime/3600 < 24) printf("\033[18C%s%sUWUPTIME %s%lih, %lim\n", NORMAL, BOLD, NORMAL, sys.uptime/3600, sys.uptime/60%60); else