From 7d0816bdf2ef9667646a6fb8ba03c5d115e62cbf Mon Sep 17 00:00:00 2001 From: Joshua T Corbin Date: Fri, 29 Dec 2023 11:12:04 -0500 Subject: [PATCH] Improve wayland wm detection - permission denied spam from fuser was getting conflated into stdout - unquote the inner $tmp_pid refereence, so that the shell will strip whitespace properly around the output pid number --- neofetch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/neofetch b/neofetch index 48b96d21..b80b363c 100755 --- a/neofetch +++ b/neofetch @@ -1899,9 +1899,9 @@ get_wm() { esac if [[ -O "${XDG_RUNTIME_DIR}/${WAYLAND_DISPLAY:-wayland-0}" ]]; then - if tmp_pid="$(lsof -t "${XDG_RUNTIME_DIR}/${WAYLAND_DISPLAY:-wayland-0}" 2>&1)" || - tmp_pid="$(fuser "${XDG_RUNTIME_DIR}/${WAYLAND_DISPLAY:-wayland-0}" 2>&1)"; then - wm="$(ps -p "${tmp_pid}" -ho comm=)" + if tmp_pid="$(lsof -t "${XDG_RUNTIME_DIR}/${WAYLAND_DISPLAY:-wayland-0}" 2>/dev/null)" || + tmp_pid="$(fuser "${XDG_RUNTIME_DIR}/${WAYLAND_DISPLAY:-wayland-0}" 2>/dev/null)"; then + wm="$(ps -p ${tmp_pid} -ho comm=)" else # lsof may not exist, or may need root on some systems. Similarly fuser. # On those systems we search for a list of known window managers, this can mistakenly