aboutsummaryrefslogtreecommitdiff
path: root/debug/font-issues.zsh
diff options
context:
space:
mode:
authorDominik Ritter <dritter03@googlemail.com>2019-02-03 10:35:46 +0300
committerDominik Ritter <dritter03@googlemail.com>2019-02-03 10:35:46 +0300
commit0081152c28edb96bd12d943803cd01cc5ac6e497 (patch)
treebf9beadef62f9eabdc9419c22ee2f314d8dd9969 /debug/font-issues.zsh
parent4b9ccc33bf9279b9bcb575f5088d0a139aeef71e (diff)
Fix parsing font for Kitty
Diffstat (limited to 'debug/font-issues.zsh')
-rwxr-xr-xdebug/font-issues.zsh20
1 files changed, 6 insertions, 14 deletions
diff --git a/debug/font-issues.zsh b/debug/font-issues.zsh
index 6b505d36..6b663514 100755
--- a/debug/font-issues.zsh
+++ b/debug/font-issues.zsh
@@ -201,21 +201,13 @@ END
;;
"kitty"*)
- shopt -s nullglob
- confs=({$KITTY_CONFIG_DIRECTORY,$XDG_CONFIG_HOME,~/Library/Preferences}/kitty/kitty.con?)
- shopt -u nullglob
-
- [[ -f "${confs[0]}" ]] || return
+ kitty_config="$(kitty --debug-config)"
+ [[ "$kitty_config" != *font_family* ]] && return
- term_font="$(awk '/^([[:space:]]*|[^#_])font_family[[:space:]]+/ {
- $1 = "";
- gsub(/^[[:space:]]/, "");
- font = $0
- }
- /^([[:space:]]*|[^#_])font_size[[:space:]]+/ {
- size = $2
- }
- END { print font " " size}' "${confs[0]}")"
+ term_font_size="${kitty_config/*font_size}"
+ term_font_size="${term_font_size/$'\n'*}"
+ term_font="${kitty_config/*font_family}"
+ term_font="${term_font/$'\n'*} $term_font_size"
;;
"konsole"*)