This repository has been archived on 2022-03-25. You can view files and clone it, but cannot push or open issues or pull requests.
manjaroConfiguration/installFish.sh

92 lines
4.2 KiB
Bash
Raw Normal View History

2022-02-15 09:26:55 +01:00
#!/usr/bin/env bash
2021-11-14 00:44:24 +01:00
# Adds the official Fish repository
2021-11-08 15:33:23 +01:00
sudo apt-add-repository ppa:fish-shell/release-3 -y
2021-12-28 17:05:59 +01:00
2021-11-14 00:44:24 +01:00
# Updates the list
2021-11-08 15:33:23 +01:00
sudo apt update
2021-12-28 17:05:59 +01:00
2022-01-20 11:55:03 +01:00
# Install Fish, fzf (for the reverse search), bat (for the colored manuals and cat), procps (for the SSH), curl (for downloading scripts), exa (for the better ls)
sudo apt install fish fzf bat procps curl exa -y
echo -e "\nFish installed!"
2021-12-28 17:05:59 +01:00
2021-11-14 00:44:24 +01:00
# Fish default shell
2022-02-15 09:26:55 +01:00
sudo chsh -s /usr/bin/fish "$USER"
2021-12-28 17:05:59 +01:00
2021-11-14 00:44:24 +01:00
# Removing motd
fish -c 'set -U fish_greeting'
2021-12-28 17:05:59 +01:00
2021-11-14 00:44:24 +01:00
# Install ^R (reversed research)
2021-11-08 15:33:23 +01:00
curl -sL https://git.io/fisher | fish -c 'source && fisher install jorgebucaran/fisher'
fish -c 'fisher install jethrokuan/fzf'
2021-12-28 17:05:59 +01:00
2021-11-14 00:44:24 +01:00
# Install SSH
2022-02-15 09:26:55 +01:00
rm "$HOME"/.config/fish/functions/fish_ssh_agent.fish 2>/dev/null; wget https://gitlab.com/kyb/fish_ssh_agent/raw/master/functions/fish_ssh_agent.fish -P "$HOME"/.config/fish/functions/
2021-12-28 17:05:59 +01:00
2021-11-14 00:44:24 +01:00
# Update the fish config with mine (edit that once installed for you)
2022-02-15 09:26:55 +01:00
rm "$HOME"/.config/fish/config.fish 2>/dev/null; wget https://git.kennel.ml/Anri/myLinuxConfiguration/raw/branch/main/.config/fish/config.fish -P "$HOME"/.config/fish/
2021-12-28 17:05:59 +01:00
2021-11-14 00:44:24 +01:00
# Update the prompt with mine
2022-02-15 09:26:55 +01:00
rm "$HOME"/.config/fish/functions/fish_prompt.fish 2>/dev/null; wget https://git.kennel.ml/Anri/myLinuxConfiguration/raw/branch/main/.config/fish/functions/fish_prompt.fish -P "$HOME"/.config/fish/functions/
2021-12-28 17:05:59 +01:00
2021-11-14 00:44:24 +01:00
# Updating color scheme (based on Base16 Eighties)
2021-11-08 17:51:45 +01:00
fish -c 'set -U fish_color_normal normal'
fish -c 'set -U fish_color_command 99cc99'
fish -c 'set -U fish_color_quote ffcc66'
fish -c 'set -U fish_color_redirection d3d0c8'
fish -c 'set -U fish_color_end cc99cc'
fish -c 'set -U fish_color_error f2777a'
fish -c 'set -U fish_color_param d3d0c8'
fish -c 'set -U fish_color_comment ffcc66'
fish -c 'set -U fish_color_match 6699cc'
fish -c 'set -U fish_color_selection white --bold --background=brblack'
fish -c 'set -U fish_color_search_match bryellow --background=brblack'
fish -c 'set -U fish_color_history_current --bold'
fish -c 'set -U fish_color_operator 6699cc'
fish -c 'set -U fish_color_escape 66cccc'
fish -c 'set -U fish_color_cwd green'
fish -c 'set -U fish_color_cwd_root red'
fish -c 'set -U fish_color_valid_path --underline'
fish -c 'set -U fish_color_autosuggestion 747369'
fish -c 'set -U fish_color_user brgreen'
fish -c 'set -U fish_color_host normal'
fish -c 'set -U fish_color_cancel -r'
fish -c 'set -U fish_pager_color_completion normal'
fish -c 'set -U fish_pager_color_description B3A06D yellow'
fish -c 'set -U fish_pager_color_prefix normal --bold --underline'
fish -c 'set -U fish_pager_color_progress brwhite --background=cyan'
2021-11-14 19:55:23 +01:00
# Adding abbrevations
2022-01-20 12:02:50 +01:00
fish -c "abbr ls 'exa -glh'"
2021-11-22 14:53:41 +01:00
fish -c "abbr cp 'cp -rv'"
2021-11-14 20:23:26 +01:00
fish -c "abbr rm 'rm -rf'"
fish -c "abbr gcc 'gcc -Wall -Wextra -fanalyzer -g'"
2022-01-24 17:35:17 +01:00
fish -c "abbr g++ 'g++ -Wall -Wextra -fanalyzer -g -std=c++17'"
2021-11-14 20:23:26 +01:00
fish -c "abbr activate 'source bin/activate.fish'"
fish -c "abbr vs 'code .'"
fish -c "abbr untgz 'tar -xvzf'"
2021-12-06 16:10:17 +01:00
fish -c "abbr - 'cd -'"
2022-01-20 11:56:13 +01:00
fish -c "abbr cat 'batcat'"
2021-12-28 17:05:59 +01:00
if grep "WSL" /proc/version > /dev/null; # only for WSL
2021-11-14 19:55:23 +01:00
then
2022-01-20 11:49:40 +01:00
fish -c "abbr bigupdate 'sudo apt update && sudo apt upgrade -y && sudo apt full-upgrade -y && sudo apt autoremove -y && tldr --update && wget -q --show-progress https://git.kennel.ml/Anri/myLinuxConfiguration/raw/branch/main/update.sh -O tmp_u.sh && bash tmp_u.sh; rm tmp_u.sh'"
2021-11-14 20:24:50 +01:00
fish -c "abbr d 'explorer.exe .'"
2021-11-14 19:55:23 +01:00
else # if regular distro (i.e. Ubuntu)
2022-01-20 11:49:40 +01:00
fish -c "abbr bigupdate 'sudo apt update && sudo apt upgrade -y && sudo apt autoremove -y && sudo snap refresh && tldr --update && wget -q --show-progress https://git.kennel.ml/Anri/myLinuxConfiguration/raw/branch/main/update.sh -O tmp_u.sh && bash tmp_u.sh; rm tmp_u.sh'"
fish -c "abbr d 'nautilus . -w &> /dev/null & disown'"
2021-12-02 15:26:19 +01:00
fish -c "abbr spotify 'LD_PRELOAD=/usr/local/lib/spotify-adblock.so spotify &> /dev/null & disown'"
2021-11-14 19:55:23 +01:00
fi
2021-12-28 17:05:59 +01:00
if grep "Ubuntu" /proc/version > /dev/null; # only for Ubuntu
2021-12-28 16:29:42 +01:00
then
# We remove the Ubuntu desktop shortcut only if it already exists
if [ -f /usr/share/applications/fish.desktop ]
then
sudo mv /usr/share/applications/fish.desktop /usr/share/applications/fish.desktop.bak
2021-12-28 16:34:39 +01:00
echo -e "\nFish icon removed!"
2021-12-28 16:29:42 +01:00
fi
fi
echo -e "\nFish configured! 🎉"
2021-11-08 17:51:45 +01:00
echo "You must log out to finish applying the changes."