Image: Only call grep once
This commit is contained in:
parent
9c9e08f17d
commit
0fd55c5b5c
1 changed files with 2 additions and 1 deletions
3
neofetch
3
neofetch
|
@ -2147,7 +2147,8 @@ get_term_size() {
|
||||||
elif type -p xwininfo >/dev/null 2>&1; then
|
elif type -p xwininfo >/dev/null 2>&1; then
|
||||||
# Get the focused window's ID.
|
# Get the focused window's ID.
|
||||||
if type -p xdpyinfo >/dev/null 2>&1; then
|
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
|
elif type -p xprop >/dev/null 2>&1; then
|
||||||
current_window="$(xprop -root | awk '/_NET_ACTIVE_WINDOW\(WINDOW\)/{print $NF}')"
|
current_window="$(xprop -root | awk '/_NET_ACTIVE_WINDOW\(WINDOW\)/{print $NF}')"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue