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
|
# Get Process ID of current konsole window / tab
|
||||||
child="$(get_ppid "$$")"
|
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
|
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
|
for session in "${konsole_sessions[@]}"; do
|
||||||
if ((child == "$(qdbus "${i}" "${session}" processId)")); then
|
if ((child == "$(qdbus "$i" "$session" processId)")); then
|
||||||
profile="$(qdbus "${i}" "${session}" environment |\
|
profile="$(qdbus "$i" "$session" environment |\
|
||||||
awk -F '=' '/KONSOLE_PROFILE_NAME/ {print $2}')"
|
awk -F '=' '/KONSOLE_PROFILE_NAME/ {print $2}')"
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
|
@ -2889,8 +2890,9 @@ END
|
||||||
done
|
done
|
||||||
|
|
||||||
# We could have two profile files for the same profile name, take first match
|
# 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="${profile_filename/$'\n'*}"
|
||||||
|
|
||||||
[[ "$profile_filename" ]] && \
|
[[ "$profile_filename" ]] && \
|
||||||
term_font="$(awk -F '=|,' '/Font=/ {print $2 " " $3}' "$profile_filename")"
|
term_font="$(awk -F '=|,' '/Font=/ {print $2 " " $3}' "$profile_filename")"
|
||||||
;;
|
;;
|
||||||
|
|
Reference in New Issue