From 6029a9532423f4ae098331c2a0d96fa318136390 Mon Sep 17 00:00:00 2001 From: Andrey Astafyev Date: Sun, 12 Dec 2021 19:28:51 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A0=D0=B5=D1=84=D0=B0=D0=BA=D1=82=D0=BE?= =?UTF-8?q?=D1=80=D0=B8=D0=BD=D0=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 65-scripts.zsh | 22 ++++++++++++---------- 95-finish.zsh | 2 +- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/65-scripts.zsh b/65-scripts.zsh index 600525f..45f557b 100644 --- a/65-scripts.zsh +++ b/65-scripts.zsh @@ -87,21 +87,23 @@ getip() { # Автоматическая установка описания терминала xterm-kitty kitty-install-terminfo() { - if [[ "x${TERM}" = "xxterm-kitty" ]]; then - if ! infocmp "xterm-kitty" > /dev/null 2>&1 ; then - if ! sudo apt-get install kitty-terminfo > /dev/null 2>&1 ; then - mkdir -p "${HOME}/.terminfo/x" - cp -ap "${ZDOTDIR}/terminfo/xterm-kitty" "${HOME}/.terminfo/x" - fi - echo "Terminal description for xterm-kitty was installed." - echo "Close terminal and start again." - fi + if ! sudo apt-get install kitty-terminfo > /dev/null 2>&1 ; then + mkdir -p "${HOME}/.terminfo/x" + cp -ap "${ZDOTDIR}/terminfo/xterm-kitty" "${HOME}/.terminfo/x" fi + echo "Terminal description for xterm-kitty was installed." + echo "Close terminal and start again." } +if [[ "x${TERM}" = "xxterm-kitty" ]]; then + if infocmp "xterm-kitty" > /dev/null 2>&1 ; then + unset -f kitty-install-terminfo + fi +fi + # Настройка mc для работы в kitty (mc не должен быть запущен) mc-kitty-add() { - local mc_cfg="${HOME}/.config/mc/ini.test" + local mc_cfg="${HOME}/.config/mc/ini" local mc_term="${ZDOTDIR}/terminfo/mc-kitty.ini" [[ "x$1" == "x-f" ]] && sed -i '/\[terminal:xterm-kitty\]/,/^$/{d}' "${mc_cfg}" diff --git a/95-finish.zsh b/95-finish.zsh index 06ee348..b7b713f 100644 --- a/95-finish.zsh +++ b/95-finish.zsh @@ -1,5 +1,5 @@ zcomet compinit mc-kitty-add -kitty-install-terminfo +[ declare -f -F kitty-install-terminfo ] && kitty-install-terminfo