Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Improve wayland wm detection #2430

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions neofetch
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down