From 9c9a0cb5e6b5f3d822b36db93e25433802b33585 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sat, 5 May 2018 08:03:10 +1000 Subject: [PATCH 1/3] general: Add back wm_version. --- neofetch | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/neofetch b/neofetch index dc65de71..13dab3f4 100755 --- a/neofetch +++ b/neofetch @@ -352,6 +352,16 @@ gtk3="on" public_ip_host="http://ident.me" +# Window Manager + + +# Show Window Manager Version. +# +# Default: 'off' +# Values: 'on', off +# Flag: --wm_version +wm_version="off" + # Disk @@ -1583,6 +1593,19 @@ get_wm() { -e "monsterwm" \ -e "tinywm")" + 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/copyright*}" + wmv="${wmv/version }" + wmv="${wmv/©*}" + wmv="${wmv/(c)*}" + wmv="${wmv/ : }" + wm="$wmv" + fi + else case "$os" in "Mac OS X") @@ -4667,6 +4690,7 @@ INFO: NOTE: This only supports Linux. + --wm_version on/off Show/Hide Window Manager version. --gtk_shorthand on/off Shorten output of gtk theme/icons --gtk2 on/off Enable/Disable gtk2 theme/font/icons output --gtk3 on/off Enable/Disable gtk3 theme/font/icons output @@ -4837,6 +4861,7 @@ get_args() { "--cpu_brand") cpu_brand="$2" ;; "--gpu_brand") gpu_brand="$2" ;; "--gpu_type") gpu_type="$2" ;; + "--wm_version") wm_version="$2" ;; "--refresh_rate") refresh_rate="$2" ;; "--gtk_shorthand") gtk_shorthand="$2" ;; "--gtk2") gtk2="$2" ;; From ef39bbc078a3f14ce22825fc7e5d0565bbe5a936 Mon Sep 17 00:00:00 2001 From: Michael Straube Date: Sat, 19 May 2018 14:19:38 +0200 Subject: [PATCH 2/3] wm_version: add case for kwin --- neofetch | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/neofetch b/neofetch index 13dab3f4..7c22e364 100755 --- a/neofetch +++ b/neofetch @@ -1594,8 +1594,10 @@ get_wm() { -e "tinywm")" if [[ "$wm_version" == "on" && "$wm" ]]; then - wmv="$("${wm,,}" --version || "${wm,,}" -v 2>&1)" - wmv="$wm ${wmv:-$("${wm,,}_x11" -v || "${wm,,}_wayland" -v)}" + case "$wm" in + "KWin") wmv="$wm $("${wm,,}_x11" -v || "${wm,,}_wayland" -v)" ;; + *) wmv="$("${wm,,}" --version || "${wm,,}" -v 2>&1)" ;; + esac wmv="${wmv/$wm ${wm}?/$wm }" wmv="${wmv/$wm $wm/$wm}" wmv="${wmv/copyright*}" From f2ff5d1d0bc7ff3bdb11ac6998701a9e33a4c1d8 Mon Sep 17 00:00:00 2001 From: Michael Straube Date: Sun, 20 May 2018 10:47:01 +0200 Subject: [PATCH 3/3] wm_version: add support for xfwm4 --- neofetch | 2 ++ 1 file changed, 2 insertions(+) diff --git a/neofetch b/neofetch index 7c22e364..5a64ebb4 100755 --- a/neofetch +++ b/neofetch @@ -1605,6 +1605,8 @@ get_wm() { wmv="${wmv/©*}" wmv="${wmv/(c)*}" wmv="${wmv/ : }" + wmv="${wmv/This is ${wm,,}/$wm}" + wmv="${wmv/(revision*}" wm="$wmv" fi