From a450fc88c5c8f1de15922cf4ee524dd88aead73f Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Mon, 7 Jan 2019 21:18:33 +0200 Subject: [PATCH] terminal font [kitty]: Use kitty command instead of parsing config files. Closes #1150 --- neofetch | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/neofetch b/neofetch index 1eea1091..3050d448 100755 --- a/neofetch +++ b/neofetch @@ -2880,21 +2880,11 @@ END ;; "kitty"*) - shopt -s nullglob - confs=({$KITTY_CONFIG_DIRECTORY,$XDG_CONFIG_HOME,~/Library/Preferences}/kitty/kitty.con?) - shopt -u nullglob - - [[ -f "${confs[0]}" ]] || 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]}")" + kitty_config="$(kitty --debug-config)" + 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" | "yakuake")