From 55de3a4201aa16f8febda3bb0cd1fdc812320799 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sat, 14 Apr 2018 08:40:28 +1000 Subject: [PATCH] general: cleanup --- neofetch | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/neofetch b/neofetch index 4c630b12..d3976574 100755 --- a/neofetch +++ b/neofetch @@ -2189,12 +2189,12 @@ END ;; "st") - [[ -z "$parent" ]] && parent="$(get_ppid "$PPID")" - term_font="$(ps -o command= -p "$parent" | grep -F -- "-f")" + if [[ "$term_font" ]]; then term_font="${term_font/*-f/}" term_font="${term_font/ -*/}" + else # On Linux we can get the exact path to the running binary through the procfs # (in case `st` is launched from outside of $PATH) on other systems we just @@ -2206,8 +2206,11 @@ END # Technically "Font Name" is a valid font. As it doesn't specify any font options # though it is hard to match it correctly amongst the rest of the noise. [[ -n "$binary" ]] && \ - term_font="$(strings "$binary" | \ - grep -F -m 1 -e "pixelsize=" -e "size=" -e "antialias=" -e "autohint=")" + term_font="$(strings "$binary" | grep -F -m 1 \ + -e "pixelsize=" \ + -e "size=" \ + -e "antialias=" \ + -e "autohint=")" fi term_font="${term_font/xft:}"