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,41 +10,25 @@ if [ "$(id -u)" = "0" ]; then
exit 1
fi
# Packages
sudo apt update
sudo apt upgrade -y
sudo apt install -y \
openssh-server \
git \
curl \
wget \
dnsutils \
rsync \
htop \
tmux \
ufw \
vnstat \
ntp \
pwgen \
fish \
fzf \
fd-find \
bat \
source-highlight
openssh-server \
git \
curl \
wget \
dnsutils \
rsync \
htop \
tmux \
ufw \
vnstat \
ntp \
pwgen
# 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
sed -i 's/#Port 22/Port 222/'
sudo systemctl restart sshd
@ -55,7 +39,7 @@ ln -sr ssh_config ~/.ssh/config
# Git
ln -sr .gitconfig ~/
ln -sr .gitconfig ~/.gitconfig
read -p "Git email: " email # avoid web scraping of email address
sed -i "s/<EMAIL>/$email/" .gitconfig
@ -65,3 +49,4 @@ sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow 222/tcp comment "sshd"
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