diff --git a/config.fish b/config.fish new file mode 100644 index 0000000..130a804 --- /dev/null +++ b/config.fish @@ -0,0 +1 @@ +fzf_configure_bindings --directory=\cf --git_log=\cg diff --git a/install/common.sh b/install/common.sh index ce696e9..9e20d57 100755 --- a/install/common.sh +++ b/install/common.sh @@ -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/" .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 diff --git a/install/fish.sh b/install/fish.sh new file mode 100755 index 0000000..3cc53d4 --- /dev/null +++ b/install/fish.sh @@ -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 <