Рефакторинг
This commit is contained in:
parent
e6e01d8917
commit
6029a95324
@ -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
|
||||
fi
|
||||
}
|
||||
|
||||
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}"
|
||||
|
@ -1,5 +1,5 @@
|
||||
zcomet compinit
|
||||
|
||||
mc-kitty-add
|
||||
kitty-install-terminfo
|
||||
[ declare -f -F kitty-install-terminfo ] && kitty-install-terminfo
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user