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