nvim/install.sh

402 lines
19 KiB
Bash
Raw Permalink Normal View History

2023-06-14 15:19:09 +07:00
#!/usr/bin/env fish
2024-06-08 16:38:50 +07:00
# Initializing the flags
set -l options (fish_opt -s v -l verbose)
set options $options (fish_opt -s f -l force)
set options $options (fish_opt -s u -l update)
# Reading the flags
argparse $options -- $argv
# Initializing the buffer of output
set -l output (if set -q _flag_verbose; echo '/dev/tty'; else; echo '/dev/null'; end)
if set -q _flag_update
begin
# need to rewrite in future (бляяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяя)
sudo apt install -y npm python3.10-venv ruby-dev pkg-config
python3 -m pip install --upgrade pip
fish_add_path ~/.local/bin
pip3 install --upgrade pynvim
sudo gem install neovim
# Install NeoVim module for NPM
sudo npm i -g neovim
end &> $output
end
2023-06-14 18:56:53 +07:00
# Инициализация текста сообщений в зависимости от установленного языка в оболочке
if test (string match -ri "ru" "$LANG")
function print -a TYPE PARAM1 PARAM2 -d "Текст сообщений"
switch $TYPE
2023-03-27 00:53:14 +07:00
case PACKER_INSTALL
set_color yellow; echo -n "[mirzaev/nvim] "; set_color blue; echo -n "[ЗАДАЧА] "; set_color white; echo "Установить Packer? (\"wbthomason/packer.nvim\") (y/N) ";
case PACKER_EXISTS
set_color yellow; echo -n "[mirzaev/nvim] "; set_color blue; echo -n "[ЗАДАЧА] "; set_color white; echo "Packer уже установлен. Переустановить? (y/N) ";
case PACKER_INSTALLED
set_color yellow; echo -n "[mirzaev/nvim] "; set_color green; echo -n "[РАБОТА] "; set_color white; echo "Установлен Packer";
case LSP_INTELEPHENSE_INSTALL
set_color yellow; echo -n "[mirzaev/nvim] "; set_color blue; echo -n "[ЗАДАЧА] "; set_color white; echo "Установить LSP-сервер для PHP? (\"bmewburn/vscode-intelephense\") (y/N) ";
case LSP_INTELEPHENSE_INSTALLED
set_color yellow; echo -n "[mirzaev/nvim] "; set_color green; echo -n "[РАБОТА] "; set_color white; echo "Установлен LSP-сервер для PHP (\"bmewburn/vscode-intelephense\")";
case LSP_VSCODE-LANGSERVERS_INSTALL
set_color yellow; echo -n "[mirzaev/nvim] "; set_color blue; echo -n "[ЗАДАЧА] "; set_color white; echo "Установить LSP-сервера от VSCode (JSON, HTML, CSS)? (\"hrsh7th/vscode-langservers-extracted\") (y/N) ";
case LSP_VSCODE-LANGSERVERS_INSTALLED
set_color yellow; echo -n "[mirzaev/nvim] "; set_color green; echo -n "[РАБОТА] "; set_color white; echo "Установлены LSP-сервера от VSCode (JSON, HTML, CSS) (\"hrsh7th/vscode-langservers-extracted\")";
case LSP_EMMET_INSTALL
set_color yellow; echo -n "[mirzaev/nvim] "; set_color blue; echo -n "[ЗАДАЧА] "; set_color white; echo "Установить LSP-сервер для набора инструментов Emmet (HTML из CSS)? (\"aca/emmet-ls\") (y/N) ";
case LSP_EMMET_INSTALLED
set_color yellow; echo -n "[mirzaev/nvim] "; set_color green; echo -n "[РАБОТА] "; set_color white; echo "Установлен LSP-сервер для набора инструментов Emmet (HTML из CSS) (\"aca/emmet-ls\")";
case LSP_CSSMODULES_INSTALL
set_color yellow; echo -n "[mirzaev/nvim] "; set_color blue; echo -n "[ЗАДАЧА] "; set_color white; echo "Установить LSP-сервер для CSS (форматировщик)? (\"antonk52/cssmodules-language-server\") (y/N) ";
case LSP_CSSMODULES_INSTALLED
set_color yellow; echo -n "[mirzaev/nvim] "; set_color green; echo -n "[РАБОТА] "; set_color white; echo "Установлен LSP-сервер для CSS (форматировщик) (\"antonk52/cssmodules-language-server\")";
case LSP_DENO_INSTALL
set_color yellow; echo -n "[mirzaev/nvim] "; set_color blue; echo -n "[ЗАДАЧА] "; set_color white; echo "Установить LSP-сервер для JavaScript и PostScript? (\"denoland/deno\") (y/N) ";
case LSP_DENO_INSTALLED
set_color yellow; echo -n "[mirzaev/nvim] "; set_color green; echo -n "[РАБОТА] "; set_color white; echo "Установлен LSP-сервер для JavaScript и PostScript (\"denoland/deno\")";
case LSP_LUA_INSTALL
set_color yellow; echo -n "[mirzaev/nvim] "; set_color blue; echo -n "[ЗАДАЧА] "; set_color white; echo "Установить LSP-сервер для Lua? (\"luals/lua-language-server\") (y/N) ";
case LSP_LUA_INSTALLED
set_color yellow; echo -n "[mirzaev/nvim] "; set_color green; echo -n "[РАБОТА] "; set_color white; echo "Установлен LSP-сервер для Lua (\"luals/lua-language-server\")";
case FORMATTER_NGINX_INSTALL
set_color yellow; echo -n "[mirzaev/nvim] "; set_color blue; echo -n "[ЗАДАЧА] "; set_color white; echo "Установить форматировщик для NGINX? (\"vasilevich/nginxbeautifier\") (y/N) ";
2023-03-27 00:53:14 +07:00
case FORMATTER_NGINX_INSTALLED
set_color yellow; echo -n "[mirzaev/nvim] "; set_color green; echo -n "[РАБОТА] "; set_color white; echo "Установлен форматировщик для NGINX (\"vasilevich/nginxbeautifier\")";
2023-06-14 18:56:53 +07:00
case FORMATTER_PRETTIER_INSTALL
set_color yellow; echo -n "[mirzaev/nvim] "; set_color blue; echo -n "[ЗАДАЧА] "; set_color white; echo "Установить форматировщик Prettier? (\"prettier/vim-prettier\") (y/N) ";
case FORMATTER_PRETTIER_INSTALLED
set_color yellow; echo -n "[mirzaev/nvim] "; set_color green; echo -n "[РАБОТА] "; set_color white; echo "Установлен форматировщик Prettier (\"prettier/vim-prettier\")";
2024-03-23 21:10:23 +07:00
case FONT_INSTALL
2024-06-03 21:53:37 +07:00
set_color yellow; echo -n "[mirzaev/nvim] "; set_color blue; echo -n "[ЗАДАЧА] "; set_color white; echo "Установить шрифт "(set_color cyan)"FiraCode"(set_color white)"? (y/N) ";
2024-03-23 21:10:23 +07:00
case FONT_INSTALLED
2024-06-03 21:53:37 +07:00
set_color yellow; echo -n "[mirzaev/nvim] "; set_color green; echo -n "[РАБОТА] "; set_color white; echo "Установлен шрифт "(set_color cyan)"FiraCode"(set_color white)" (выбери его в настройках твоего эмулятора терминала)";
2024-03-23 21:10:23 +07:00
case FONTS
2024-06-03 21:53:37 +07:00
set_color yellow; echo -n "[mirzaev/nvim] "; set_color magenta; echo -n "[ДАННЫЕ] "; set_color white; echo "Шрифты для GNOME эмулятора терминала: https://www.nerdfonts.com/font-downloads (моя рекомендация - "(set_color cyan)"FiraCode"(set_color white)")";
2024-03-22 04:50:20 +07:00
case FONT_PATCH
2024-06-08 16:38:50 +07:00
set_color yellow; echo -n "[mirzaev/nvim] "; set_color blue; echo -n "[ЗАДАЧА] "; set_color white; echo "Пропатчить шрифт для иконок? (\"nvim-tree/nvim-web-devicons\") (y/N) ";
2024-03-22 04:50:20 +07:00
case FONT_CHOOSE
2024-06-08 16:38:50 +07:00
set_color yellow; echo -n "[mirzaev/nvim] "; set_color blue; echo -n "[ЗАДАЧА] "; set_color white; echo "Путь до шрифта";
2024-03-22 04:50:20 +07:00
case FONT_PATCHED
2024-03-23 21:10:23 +07:00
set_color yellow; echo -n "[mirzaev/nvim] "; set_color green; echo -n "[РАБОТА] "; set_color white; echo "Пропатчен шрифт для иконок (\"nvim-tree/nvim-web-devicons\")";
end
end
else
function print -a TYPE PARAM1 PARAM2 -d "Messages text"
switch $TYPE
2023-03-27 00:53:14 +07:00
case PACKER_INSTALL
set_color yellow; echo -n "[mirzaev/nvim] "; set_color blue; echo -n "[TASK] "; set_color white; echo "Install Packer? (\"wbthomason/packer.nvim\") (y/N) ";
case PACKER_EXISTS
set_color yellow; echo -n "[mirzaev/nvim] "; set_color blue; echo -n "[TASK] "; set_color white; echo "Packer already installed. Reinstall? (y/N) ";
case PACKER_INSTALLED
set_color yellow; echo -n "[mirzaev/nvim] "; set_color green; echo -n "[WORK] "; set_color white; echo "Installed Packer";
case LSP_INTELEPHENSE_INSTALL
set_color yellow; echo -n "[mirzaev/nvim] "; set_color blue; echo -n "[TASK] "; set_color white; echo "Install the LSP-server for PHP? (\"bmewburn/vscode-intelephense\") (y/N) ";
case LSP_INTELEPHENSE_INSTALLED
set_color yellow; echo -n "[mirzaev/nvim] "; set_color green; echo -n "[WORK] "; set_color white; echo "Installed the LSP-server for PHP (\"bmewburn/vscode-intelephense\")";
case LSP_VSCODE-LANGSERVERS_INSTALL
set_color yellow; echo -n "[mirzaev/nvim] "; set_color blue; echo -n "[TASK] "; set_color white; echo "Install the LSP-servers from VSCode (JSON, HTML, CSS)? (\"hrsh7th/vscode-langservers-extracted\") (y/N) ";
case LSP_VSCODE-LANGSERVERS_INSTALLED
set_color yellow; echo -n "[mirzaev/nvim] "; set_color green; echo -n "[WORK] "; set_color white; echo "Installed the LSP-servers from VSCode (JSON, HTML, CSS) (\"hrsh7th/vscode-langservers-extracted\")";
case LSP_EMMET_INSTALL
set_color yellow; echo -n "[mirzaev/nvim] "; set_color blue; echo -n "[TASK] "; set_color white; echo "Install the LSP-server for Emmet toolkit (HTML из CSS)? (\"aca/emmet-ls\") (y/N) ";
case LSP_EMMET_INSTALLED
set_color yellow; echo -n "[mirzaev/nvim] "; set_color green; echo -n "[WORK] "; set_color white; echo "Installed the LSP-server for Emmet toolkit (HTML из CSS) (\"aca/emmet-ls\")";
case LSP_CSSMODULES_INSTALL
set_color yellow; echo -n "[mirzaev/nvim] "; set_color blue; echo -n "[TASK] "; set_color white; echo "Install the LSP-server for CSS (formatter)? (\"antonk52/cssmodules-language-server\") (y/N) ";
case LSP_CSSMODULES_INSTALLED
set_color yellow; echo -n "[mirzaev/nvim] "; set_color green; echo -n "[WORK] "; set_color white; echo "Install the LSP-server for CSS (formatter) (\"antonk52/cssmodules-language-server\")";
case LSP_DENO_INSTALL
2024-06-08 16:38:50 +07:00
set_color yellow; echo -n "[mirzaev/nvim] "; set_color blue; echo -n "[TASK] "; set_color white; echo "Install the LSP-server for JavaScript and PostScript? (\"denoland/deno\") (y/N) ";
2023-03-27 00:53:14 +07:00
case LSP_DENO_INSTALLED
2024-06-08 16:38:50 +07:00
set_color yellow; echo -n "[mirzaev/nvim] "; set_color green; echo -n "[WORK] "; set_color white; echo "Installed the LSP-server for JavaScript and PostScript (\"denoland/deno\")";
2023-03-27 00:53:14 +07:00
case LSP_LUA_INSTALL
set_color yellow; echo -n "[mirzaev/nvim] "; set_color blue; echo -n "[TASK] "; set_color white; echo "Install the LSP-server for Lua? (\"luals/lua-language-server\") (y/N) ";
case LSP_LUA_INSTALLED
set_color yellow; echo -n "[mirzaev/nvim] "; set_color green; echo -n "[WORK] "; set_color white; echo "Installed the LSP-server for Lua (\"luals/lua-language-server\")";
case FORMATTER_NGINX_INSTALL
set_color yellow; echo -n "[mirzaev/nvim] "; set_color blue; echo -n "[TASK] "; set_color white; echo "Install the formatter for NGINX? (\"vasilevich/nginxbeautifier\") (y/N) ";
2023-03-27 00:53:14 +07:00
case FORMATTER_NGINX_INSTALLED
set_color yellow; echo -n "[mirzaev/nvim] "; set_color green; echo -n "[WORK] "; set_color white; echo "Installed the formatter for NGINX (\"vasilevich/nginxbeautifier\")";
2023-06-14 18:56:53 +07:00
case FORMATTER_PRETTIER_INSTALL
set_color yellow; echo -n "[mirzaev/nvim] "; set_color blue; echo -n "[TASK] "; set_color white; echo "Install the formatter Prettier? (\"prettier/vim-prettier\") (y/N) ";
case FORMATTER_PRETTIER_INSTALLED
set_color yellow; echo -n "[mirzaev/nvim] "; set_color green; echo -n "[WORK] "; set_color white; echo "Installed the formatter Prettier (\"prettier/vim-prettier\")";
2024-03-23 21:10:23 +07:00
case FONT_INSTALL
2024-06-03 21:53:37 +07:00
set_color yellow; echo -n "[mirzaev/nvim] "; set_color blue; echo -n "[TASK] "; set_color white; echo "Install "(set_color cyan)"FiraCode"(set_color white)" font? (y/N) ";
2024-03-23 21:10:23 +07:00
case FONT_INSTALLED
2024-06-03 21:53:37 +07:00
set_color yellow; echo -n "[mirzaev/nvim] "; set_color green; echo -n "[WORK] "; set_color white; echo "Installed "(set_color cyan)"FiraCode"(set_color white)" font (select it in your terminal emulator settings)";
2024-03-23 21:10:23 +07:00
case FONTS
2024-06-08 16:38:50 +07:00
set_color yellow; echo -n "[mirzaev/nvim] "; set_color magenta; echo -n "[INFO] "; set_color white; echo "Fonts for GNOME terminal emulator: https://www.nerdfonts.com/font-downloads (my recommendation - "(set_color cyan)"FiraCode"(set_color white)") ";
2024-03-22 04:50:20 +07:00
case FONT_PATCH
2024-06-08 16:38:50 +07:00
set_color yellow; echo -n "[mirzaev/nvim] "; set_color blue; echo -n "[TASK] "; set_color white; echo "Patch your font for icons? (\"nvim-tree/nvim-web-devicons\") (y/N) ";
2024-03-22 04:50:20 +07:00
case FONT_CHOOSE
2024-06-08 16:38:50 +07:00
set_color yellow; echo -n "[mirzaev/nvim] "; set_color blue; echo -n "[TASK] "; set_color white; echo "Path to the font";
2024-03-22 04:50:20 +07:00
case FONT_PATCHED
2024-03-23 21:10:23 +07:00
set_color yellow; echo -n "[mirzaev/nvim] "; set_color green; echo -n "[WORK] "; set_color white; echo "Pathed the font for icons (\"nvim-tree/nvim-web-devicons\")";
2024-06-08 16:38:50 +07:00
end
2023-03-27 00:53:14 +07:00
end
end
2024-06-08 16:38:50 +07:00
if not set -q _flag_force
# Installation request
set RESPONSE (read -n 1 -p "print PACKER_INSTALL")
bind -e y
end
2024-06-08 16:38:50 +07:00
if set -q _flag_force; or test (string match -ri 'y' "$RESPONSE")
2023-03-27 00:53:14 +07:00
if test -d ~/.local/share/nvim/site/pack/packer/start/packer.nvim
# Найден репозиторий "wbthomason/packer.nvim"
2024-06-08 16:38:50 +07:00
if not set -q _flag_force
# Installation request
set RESPONSE (read -n 1 -p "print PACKER_EXISTS")
bind -e y
end
2024-06-08 16:38:50 +07:00
if set -q _flag_force; or test (string match -ri 'y' "$RESPONSE")
2023-03-27 00:53:14 +07:00
# Запрошена переустановка
2024-06-08 16:38:50 +07:00
begin
# Деинициализация старого репозитория
rm -rf ~/.local/share/nvim/site/pack/packer/start/packer.nvim
2024-06-08 16:38:50 +07:00
# Инициализация репозитория
git clone --depth 1 https://github.com/wbthomason/packer.nvim\
~/.local/share/nvim/site/pack/packer/start/packer.nvim
end &> $output
2023-03-27 00:53:14 +07:00
print PACKER_INSTALLED
end
else
# Не найден репозиторий "wbthomason/packer.nvim"
2024-06-08 16:38:50 +07:00
begin
# Инициализация репозитория
git clone --depth 1 https://github.com/wbthomason/packer.nvim\
~/.local/share/nvim/site/pack/packer/start/packer.nvim
end &> $output
2023-03-27 00:53:14 +07:00
print PACKER_INSTALLED
end
end
2024-06-08 16:38:50 +07:00
if not set -q _flag_force
# Installation request
set RESPONSE (read -n 1 -p "print LSP_INTELEPHENSE_INSTALL")
bind -e y
end
2023-03-27 00:53:14 +07:00
2024-06-08 16:38:50 +07:00
if set -q _flag_force; or test (string match -ri 'y' "$RESPONSE")
2023-03-27 00:53:14 +07:00
# Запрошена установка "bmewburn/vscode-intelephense"
2024-06-08 16:38:50 +07:00
begin
# Установка
sudo npm i -g intelephense
end &> $output
2023-03-27 00:53:14 +07:00
print LSP_INTELEPHENSE_INSTALLED
end
2024-06-08 16:38:50 +07:00
if not set -q _flag_force
# Installation request
set RESPONSE (read -n 1 -p "print LSP_VSCODE-LANGSERVERS_INSTALL")
bind -e y
end
2023-03-27 00:53:14 +07:00
2024-06-08 16:38:50 +07:00
if set -q _flag_force; or test (string match -ri 'y' "$RESPONSE")
2023-03-27 00:53:14 +07:00
# Запрошена установка "hrsh7th/vscode-langservers-extracted"
2024-06-08 16:38:50 +07:00
begin
# Установка
sudo npm i -g vscode-langservers-extracted
end &> $output
2023-03-27 00:53:14 +07:00
print LSP_VSCODE-LANGSERVERS_INSTALLED
end
2024-06-08 16:38:50 +07:00
if not set -q _flag_force
# Installation request
set RESPONSE (read -n 1 -p "print LSP_EMMET_INSTALL")
bind -e y
end
2023-03-27 00:53:14 +07:00
2024-06-08 16:38:50 +07:00
if set -q _flag_force; or test (string match -ri 'y' "$RESPONSE")
2023-03-27 00:53:14 +07:00
# Запрошена установка "aca/emmet-ls"
2024-06-08 16:38:50 +07:00
begin
# Установка
sudo npm i -g emmet-ls
end &> $output
2023-03-27 00:53:14 +07:00
print LSP_EMMET_INSTALLED
end
2024-06-08 16:38:50 +07:00
if not set -q _flag_force
# Installation request
set RESPONSE (read -n 1 -p "print LSP_CSSMODULES_INSTALL")
bind -e y
end
2023-03-27 00:53:14 +07:00
2024-06-08 16:38:50 +07:00
if set -q _flag_force; or test (string match -ri 'y' "$RESPONSE")
2023-03-27 00:53:14 +07:00
# Запрошена установка "antonk52/cssmodules-language-server"
2024-06-08 16:38:50 +07:00
begin
# Установка
sudo npm i -g cssmodules-language-server
end &> $output
2023-03-27 00:53:14 +07:00
print LSP_CSSMODULES_INSTALLED
end
2024-06-08 16:38:50 +07:00
if not set -q _flag_force
# Installation request
set RESPONSE (read -n 1 -p "print LSP_DENO_INSTALL")
bind -e y
end
2023-03-27 00:53:14 +07:00
2024-06-08 16:38:50 +07:00
if set -q _flag_force; or test (string match -ri 'y' "$RESPONSE")
2023-03-27 00:53:14 +07:00
# Запрошена установка "denoland/deno"
2024-06-08 16:38:50 +07:00
begin
# Установка
curl -fsSL https://deno.land/install.sh | sh
end &> $output
2023-03-27 00:53:14 +07:00
2023-06-14 15:10:29 +07:00
# TODO доделать нормально
2023-06-14 15:27:21 +07:00
set -g DENO_INSTALL "$HOME/.deno"
2023-06-14 15:10:29 +07:00
fish_add_path $DENO_INSTALL/bin
2023-03-27 00:53:14 +07:00
print LSP_DENO_INSTALLED
end
2024-06-08 16:38:50 +07:00
if not set -q _flag_force
# Installation request
set RESPONSE (read -n 1 -p "print LSP_LUA_INSTALL")
bind -e y
end
if set -q _flag_force; or test (string match -ri 'y' "$RESPONSE")
2023-03-27 00:53:14 +07:00
# Запрошена установка "luals/lua-language-server"
2024-06-08 16:38:50 +07:00
begin
# Установка
sudo apt install ninja-build -y
cd ~/
rm -rf lua-language-server
git clone https://github.com/LuaLS/lua-language-server
cd lua-language-server
fish ./make.sh
fish_add_path $HOME/lua-language-server/bin
end &> $output
2023-03-27 00:53:14 +07:00
print LSP_LUA_INSTALLED
end
2024-06-08 16:38:50 +07:00
if not set -q _flag_force
# Installation request
set RESPONSE (read -n 1 -p "print FORMATTER_NGINX_INSTALL")
bind -e y
end
2023-03-27 00:53:14 +07:00
2024-06-08 16:38:50 +07:00
if set -q _flag_force; or test (string match -ri 'y' "$RESPONSE")
2023-03-27 00:53:14 +07:00
# Запрошена установка "vasilevich/nginxbeautifier"
2024-06-08 16:38:50 +07:00
begin
# Установка
sudo npm i -g nginxbeautifier
end &> $output
2023-03-27 00:53:14 +07:00
print FORMATTER_NGINX_INSTALLED
end
2023-06-14 18:56:53 +07:00
2024-06-08 16:38:50 +07:00
if not set -q _flag_force
# Installation request
set RESPONSE (read -n 1 -p "print FORMATTER_PRETTIER_INSTALL")
bind -e y
end
2023-06-14 18:56:53 +07:00
2024-06-08 16:38:50 +07:00
if set -q _flag_force; or test (string match -ri 'y' "$RESPONSE")
2023-06-14 18:56:53 +07:00
# Accepted installation of "prettier/vim-prettier"
2024-06-08 16:38:50 +07:00
begin
npm i prettier
sudo npm i -g prettier
end &> $output
2024-06-03 21:53:37 +07:00
2024-03-22 04:50:20 +07:00
print FORMATTER_PRETTIER_INSTALLED
end
2024-03-23 21:10:23 +07:00
print FONTS
2024-06-08 16:38:50 +07:00
if not set -q _flag_force
# Installation request
set RESPONSE (read -n 1 -p "print FONT_INSTALL")
bind -e y
end
if set -q _flag_force; or test (string match -ri 'y' "$RESPONSE")
2024-03-23 21:10:23 +07:00
# Accepted installation of the FiraCode font
2024-06-08 16:38:50 +07:00
begin
mkdir -p ~/.local/share/fonts/FiraCode
cd ~/.local/share/fonts/FiraCode
wget "https://github.com/ryanoasis/nerd-fonts/releases/download/v3.1.1/FiraCode.zip"
unzip -o FiraCode.zip
rm FiraCode.zip
fc-cache -f -v
end &> $output
2024-03-23 21:10:23 +07:00
print FONT_INSTALLED
2024-06-03 21:53:37 +07:00
if type -q dconf
2024-03-23 21:10:23 +07:00
# GNOME
2024-06-08 16:38:50 +07:00
# if (set -q _flag_force or string match (lsb_release -i | grep -Po '[^\s]*$') Ubuntu))
2024-03-23 21:10:23 +07:00
# sudo apt-get install dconf
# end
2024-03-22 04:50:20 +07:00
end
2024-03-23 21:10:23 +07:00
# dconf write /apps/gnome-terminal/profiles/Default/font FiraCodeNerdFontMono-Medium.ttf
# gconftool-2 --set /apps/gnome-terminal/profiles/Default/use_system_font --type=boolean false
# gconftool-2 --set /apps/gnome-terminal/profiles/Default/font --type string FiraCodeNerdFontMono-Medium.ttf
else
# Denied installation of the FiraCode font
2024-06-08 16:38:50 +07:00
if not set -q _flag_force
# Installation request
set RESPONSE (read -n 1 -p "print FONT_PATCH")
bind -e y
end
2024-03-23 21:10:23 +07:00
2024-06-08 16:38:50 +07:00
if set -q _flag_force; or test (string match -ri 'y' "$RESPONSE")
2024-03-23 21:10:23 +07:00
# Accepted to patching the font
2024-06-08 16:38:50 +07:00
begin
cd ~/
wget "https://github.com/ryanoasis/nerd-fonts/releases/latest/download/FontPatcher.zip"
unzip -o FontPatcher.zip -d font_patcher
cd font_patcher
2024-03-22 04:50:20 +07:00
2024-06-08 16:38:50 +07:00
#if not type -q python && type -q python3
if not type -q python
# alias python=python3
sudo apt install python-is-python3 -y
end
sudo apt install fontforge python3-fontforge -y
end &> $output
# Initializing path to the font
set FONT (read -p "print FONT_CHOOSE")
2023-06-14 18:56:53 +07:00
2024-06-08 16:38:50 +07:00
begin
./font-patcher $FONT
end &> $output
2024-03-23 21:10:23 +07:00
print FONT_PATCHED
end
2023-06-14 18:56:53 +07:00
end