From 84d76a7ff3cb251d7a40c3f465fb9919e841c3c1 Mon Sep 17 00:00:00 2001 From: Michael Straube Date: Sun, 22 Dec 2019 13:38:20 +0100 Subject: [PATCH 1/5] term_font: Fix font detection for Konsole >= 19.12.0 --- neofetch | 1 + 1 file changed, 1 insertion(+) diff --git a/neofetch b/neofetch index efcea319..1f977cc0 100755 --- a/neofetch +++ b/neofetch @@ -3112,6 +3112,7 @@ END if ((child == "$(qdbus "$i" "$session" processId)")); then profile="$(qdbus "$i" "$session" environment |\ awk -F '=' '/KONSOLE_PROFILE_NAME/ {print $2}')" + [[ ! $profile ]] && profile="$(qdbus "$i" "$session" profile)" break fi done From 618d5b23473c88cf787ccabbe8263aabb279f5a0 Mon Sep 17 00:00:00 2001 From: Michael Straube Date: Sun, 22 Dec 2019 13:39:38 +0100 Subject: [PATCH 2/5] term_font: konsole: Avoid wrong font info --- neofetch | 2 ++ 1 file changed, 2 insertions(+) diff --git a/neofetch b/neofetch index 1f977cc0..e9c0cc31 100755 --- a/neofetch +++ b/neofetch @@ -3119,6 +3119,8 @@ END [[ "$profile" ]] && break done + [[ ! $profile ]] && return + # We could have two profile files for the same profile name, take first match profile_filename="$(grep -l "Name=${profile}" "$HOME"/.local/share/konsole/*.profile)" profile_filename="${profile_filename/$'\n'*}" From 7ed49d57220ce693f3b47e6f4b91ffb5fb4b2491 Mon Sep 17 00:00:00 2001 From: Michael Straube Date: Sun, 22 Dec 2019 13:40:40 +0100 Subject: [PATCH 3/5] Remove quotes --- neofetch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/neofetch b/neofetch index e9c0cc31..b772a790 100755 --- a/neofetch +++ b/neofetch @@ -3116,7 +3116,7 @@ END break fi done - [[ "$profile" ]] && break + [[ $profile ]] && break done [[ ! $profile ]] && return @@ -3125,7 +3125,7 @@ END profile_filename="$(grep -l "Name=${profile}" "$HOME"/.local/share/konsole/*.profile)" profile_filename="${profile_filename/$'\n'*}" - [[ "$profile_filename" ]] && \ + [[ $profile_filename ]] && \ term_font="$(awk -F '=|,' '/Font=/ {print $2,$3}' "$profile_filename")" ;; From 9ad01bfe182799f53c537431a1b4c1b394b28d87 Mon Sep 17 00:00:00 2001 From: Michael Straube Date: Sun, 22 Dec 2019 14:15:37 +0100 Subject: [PATCH 4/5] Invert test logic --- neofetch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/neofetch b/neofetch index b772a790..2c5465ce 100755 --- a/neofetch +++ b/neofetch @@ -3112,14 +3112,14 @@ END if ((child == "$(qdbus "$i" "$session" processId)")); then profile="$(qdbus "$i" "$session" environment |\ awk -F '=' '/KONSOLE_PROFILE_NAME/ {print $2}')" - [[ ! $profile ]] && profile="$(qdbus "$i" "$session" profile)" + [[ $profile ]] || profile="$(qdbus "$i" "$session" profile)" break fi done [[ $profile ]] && break done - [[ ! $profile ]] && return + [[ $profile ]] || return # We could have two profile files for the same profile name, take first match profile_filename="$(grep -l "Name=${profile}" "$HOME"/.local/share/konsole/*.profile)" From 6e69a7183da9ffd3ec040b89a28e8eadd143a830 Mon Sep 17 00:00:00 2001 From: Michael Straube Date: Sun, 22 Dec 2019 20:08:24 +0100 Subject: [PATCH 5/5] term_font: Fix Konsole font on openSUSE --- neofetch | 2 ++ 1 file changed, 2 insertions(+) diff --git a/neofetch b/neofetch index 2c5465ce..cac3540d 100755 --- a/neofetch +++ b/neofetch @@ -3102,6 +3102,8 @@ END # Get Process ID of current konsole window / tab child="$(get_ppid "$$")" + QT_BINDIR="$(qtpaths --binaries-dir)" && PATH+=":$QT_BINDIR" + IFS=$'\n' read -d "" -ra konsole_instances \ <<< "$(qdbus | awk '/org.kde.konsole/ {print $1}')"