[F] Fix wm detection when lsof doesn't exist but fuser exists
https://github.com/hykilpikonna/hyfetch/pull/51
This commit is contained in:
parent
2117040796
commit
5c0f6bfd78
1 changed files with 1 additions and 0 deletions
1
neofetch
1
neofetch
|
@ -2213,6 +2213,7 @@ get_wm() {
|
||||||
if [[ -O "${XDG_RUNTIME_DIR}/${WAYLAND_DISPLAY:-wayland-0}" ]]; then
|
if [[ -O "${XDG_RUNTIME_DIR}/${WAYLAND_DISPLAY:-wayland-0}" ]]; then
|
||||||
if tmp_pid="$(lsof -t "${XDG_RUNTIME_DIR}/${WAYLAND_DISPLAY:-wayland-0}" 2>&1)" ||
|
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
|
tmp_pid="$(fuser "${XDG_RUNTIME_DIR}/${WAYLAND_DISPLAY:-wayland-0}" 2>&1)"; then
|
||||||
|
tmp_pid="$(trim "${tmp_pid##*:}")"
|
||||||
wm="$(ps -p "${tmp_pid}" -ho comm=)"
|
wm="$(ps -p "${tmp_pid}" -ho comm=)"
|
||||||
else
|
else
|
||||||
# lsof may not exist, or may need root on some systems. Similarly fuser.
|
# lsof may not exist, or may need root on some systems. Similarly fuser.
|
||||||
|
|
Loading…
Reference in a new issue