From 1ddcc47dd60351ec8a845a86f489fcfc3dd527bf Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Tue, 1 May 2018 19:41:44 +1000 Subject: [PATCH] wm: Added support for more window managers. --- neofetch | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/neofetch b/neofetch index f0b47303..15bcffe5 100755 --- a/neofetch +++ b/neofetch @@ -793,17 +793,16 @@ get_wm() { -e "monsterwm" \ -e "tinywm")" - if [[ "$wm_version" == "on" ]]; then - wmv="$wm $("${wm,,}" --version || \ - "${wm,,}" -v || \ - "${wm,,}_x11" -v)" || \ - "${wm,,}_wayland" -v")" + if [[ "$wm_version" == "on" && "$wm" ]]; then + wmv="$("${wm,,}" --version || "${wm,,}" -v 2>&1)" + wmv="$wm ${wmv:-$("${wm,,}_x11" -v || "${wm,,}_wayland" -v)}" + wmv="${wmv/$wm ${wm}?/$wm }" wmv="${wmv/$wm $wm/$wm}" - wmv="${wmv/$wm ${wm}?/$wm}" wmv="${wmv/copyright*}" wmv="${wmv/version }" wmv="${wmv/©*}" wmv="${wmv/(c)*}" + wmv="${wmv/ : }" wm="$wmv" fi else