zsh/fixes.zsh

27 lines
1.1 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# Установка файла описания терминала kitty на системы,
# где отсутствует пакет kitty-terminfo
fix-kitty-terminal-support() {
mkdir -p $HOME/.terminfo/x
wget -qO - https://github.com/kovidgoyal/kitty/raw/master/terminfo/x/xterm-kitty > ~/.terminfo/x/xterm-kitty
}
# Настройка mc для работы в терминале kitty
# Необходимо закрыть все экземпляры mc для текущего пользователя
# При вызове функции с параметром -f текущие настройки клавиш
# для работы mc в терминале kitty будут перезаписаны
fix-mc-kitty-support() {
local mc_cfg="${HOME}/.config/mc/ini"
[[ "$1" == "-f" ]] && sed -i '/\[terminal:xterm-kitty\]/,/^$/{d}' "${mc_cfg}"
if [ -w "${mc_cfg}" ]; then
if ! grep -qF "[terminal:xterm-kitty]" "${mc_cfg}" ; then
echo >> "${mc_cfg}"
echo "[terminal:xterm-kitty]" >> "${mc_cfg}"
echo "copy=xterm" >> "${mc_cfg}"
fi
fi
}