Merge pull request #1375 from arisinfenix/term_font

Fixes and updates for Konsole font detection
This commit is contained in:
dylan 2019-12-22 20:49:44 +00:00 committed by GitHub
commit b9ade82233
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 2 deletions

View File

@ -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}')"
@ -3112,17 +3114,20 @@ 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
[[ "$profile" ]] && break
[[ $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'*}"
[[ "$profile_filename" ]] && \
[[ $profile_filename ]] && \
term_font="$(awk -F '=|,' '/Font=/ {print $2,$3}' "$profile_filename")"
;;