From 0fd55c5b5ca4a45c979fdbd25d62f3a2f30abe3f Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Tue, 6 Dec 2016 11:46:34 +1100 Subject: [PATCH] Image: Only call grep once --- neofetch | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/neofetch b/neofetch index 520dbc9d..4e4bae80 100755 --- a/neofetch +++ b/neofetch @@ -2147,7 +2147,8 @@ get_term_size() { elif type -p xwininfo >/dev/null 2>&1; then # Get the focused window's ID. if type -p xdpyinfo >/dev/null 2>&1; then - current_window="$(xdpyinfo | grep -F "focus" | grep -E -o "0x[0-9a-f]+")" + current_window="$(xdpyinfo | grep -E -o "focus:.*0x[0-9a-f]+")" + current_window="${current_window/*window }" elif type -p xprop >/dev/null 2>&1; then current_window="$(xprop -root | awk '/_NET_ACTIVE_WINDOW\(WINDOW\)/{print $NF}')" fi