Skip to content

Commit

Permalink
Upgrade WM detection for non-EWMH WMs. 3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
q60 committed Feb 2, 2022
1 parent 42789bb commit 1002332
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions disfetch
Original file line number Diff line number Diff line change
Expand Up @@ -206,12 +206,19 @@ DESKTOP="$(
# some WM do not have proper set atoms like _NET_SUPPORTING_WM_CHECK and _NET_WM_NAME
# this workaround allows to detect such WM
wm_id=$(xprop -root -notype _NET_SUPPORTING_WM_CHECK 2>/dev/null) &&
wm="$(
xprop -id "${wm_id##* }" _NET_WM_NAME |
awk '{ print tolower($NF) }' | xargs ||
pgrep -lox "(2b|cat|d|fv|monster|so|tiny)wm|wmaker" |
cut -d' ' -f2
)"
wm="$(xprop -id "${wm_id##* }" _NET_WM_NAME 2>/dev/null |
awk '{ print tolower($NF) }' | xargs)"
[ "$wm" ] ||
wm=$(ps -eo comm= | grep -m 1 -o -e "2bwm" \
-e "catwm" \
-e "dwm" \
-e "fvwm" \
-e "monsterwm" \
-e "sowm" \
-e "tinywm" \
-e "wmaker" \
-e "xmonad")
fi
echo "$wm"
else
Expand Down

0 comments on commit 1002332

Please sign in to comment.