Archived
1
0
Fork 0

fish: clean up, add debian/ubuntu installation steps

This commit is contained in:
Casper V. Kristensen 2022-06-04 14:51:50 +02:00
parent 2d8e281552
commit a64fbb9f39
3 changed files with 50 additions and 30 deletions

1
config.fish Normal file
View file

@ -0,0 +1 @@
fzf_configure_bindings --directory=\cf --git_log=\cg

View file

@ -10,6 +10,7 @@ if [ "$(id -u)" = "0" ]; then
exit 1 exit 1
fi fi
# Packages # Packages
sudo apt update sudo apt update
sudo apt upgrade -y sudo apt upgrade -y
@ -25,26 +26,9 @@ sudo apt install -y \
ufw \ ufw \
vnstat \ vnstat \
ntp \ ntp \
pwgen \ pwgen
fish \
fzf \
fd-find \
bat \
source-highlight
# Shell
chsh -s /usr/bin/fish
# Fish fzf
curl -sL https://raw.githubusercontent.com/jorgebucaran/fisher/main/functions/fisher.fish | source && fisher install jorgebucaran/fisher
fisher install PatrickF1/fzf.fish
alias --save fd=fdfind
alias --save bat=batcat
echo "fzf_configure_bindings --directory=\cf --git_log=\cg" >> ~/.config/fish/config.fish
# Fish Pure
rm ~/.config/fish/functions/fish_prompt.fish
fisher install pure-fish/pure
# SSH # SSH
sed -i 's/#Port 22/Port 222/' sed -i 's/#Port 22/Port 222/'
sudo systemctl restart sshd sudo systemctl restart sshd
@ -55,7 +39,7 @@ ln -sr ssh_config ~/.ssh/config
# Git # Git
ln -sr .gitconfig ~/ ln -sr .gitconfig ~/.gitconfig
read -p "Git email: " email # avoid web scraping of email address read -p "Git email: " email # avoid web scraping of email address
sed -i "s/<EMAIL>/$email/" .gitconfig sed -i "s/<EMAIL>/$email/" .gitconfig
@ -65,3 +49,4 @@ sudo ufw default deny incoming
sudo ufw default allow outgoing sudo ufw default allow outgoing
sudo ufw allow 222/tcp comment "sshd" sudo ufw allow 222/tcp comment "sshd"
sudo ufw enable sudo ufw enable
sudo ufw status

34
install/fish.sh Executable file
View file

@ -0,0 +1,34 @@
#!/bin/bash
set -e
# Packages
if [ "$(lsb_release -is)" = "Ubuntu" ]; then
sudo apt install -y \
fish \
fzf \
fd-find \
bat
sudo ln -s /usr/bin/batcat /usr/local/bin/bat
sudo ln -s /usr/bin/fdfind /usr/local/bin/fd
fi
if [ "$(lsb_release -is)" = "Debian" ]; then
# We could script this, but it's probably easier to just install it manually
echo "Please install dependencies from https://github.com/PatrickF1/fzf.fish#installation"
exit
fi
# Default shell
chsh -s /usr/bin/fish
# Plugins
rm ~/.config/fish/functions/fish_prompt.fish # clean existing prompt for pure prompt
cat <<EOF | fish
# Fish fzf
curl -sL https://raw.githubusercontent.com/jorgebucaran/fisher/main/functions/fisher.fish | source && fisher install jorgebucaran/fisher
fisher install PatrickF1/fzf.fish
fisher install pure-fish/pure
EOF
ln -sr config.fish ~/.config/fish/config.fish