term_font: cleanup konsole
This commit is contained in:
parent
ea7512da2f
commit
4b684c0eb6
12
neofetch
12
neofetch
|
@ -2874,13 +2874,14 @@ END
|
|||
# Get Process ID of current konsole window / tab
|
||||
child="$(get_ppid "$$")"
|
||||
|
||||
konsole_instances=($(qdbus | grep 'org.kde.konsole'))
|
||||
IFS=$'\n' read -d "" -ra konsole_instances < <(qdbus | grep -F 'org.kde.konsole')
|
||||
|
||||
for i in "${konsole_instances[@]}"; do
|
||||
konsole_sessions=($(qdbus "${i}" | grep '/Sessions/'))
|
||||
IFS=$'\n' read -d "" -ra konsole_sessions < <(qdbus "$i" | grep -F '/Sessions/')
|
||||
|
||||
for session in "${konsole_sessions[@]}"; do
|
||||
if ((child == "$(qdbus "${i}" "${session}" processId)")); then
|
||||
profile="$(qdbus "${i}" "${session}" environment |\
|
||||
if ((child == "$(qdbus "$i" "$session" processId)")); then
|
||||
profile="$(qdbus "$i" "$session" environment |\
|
||||
awk -F '=' '/KONSOLE_PROFILE_NAME/ {print $2}')"
|
||||
break
|
||||
fi
|
||||
|
@ -2889,8 +2890,9 @@ END
|
|||
done
|
||||
|
||||
# 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="$(grep -l "Name=${profile}" "$HOME"/.local/share/konsole/*.profile)"
|
||||
profile_filename="${profile_filename/$'\n'*}"
|
||||
|
||||
[[ "$profile_filename" ]] && \
|
||||
term_font="$(awk -F '=|,' '/Font=/ {print $2 " " $3}' "$profile_filename")"
|
||||
;;
|
||||
|
|
Reference in New Issue