From a64fbb9f3988aa2801dfb78a54332e64fcc87df2 Mon Sep 17 00:00:00 2001 From: "Casper V. Kristensen" Date: Sat, 4 Jun 2022 14:51:50 +0200 Subject: [PATCH] fish: clean up, add debian/ubuntu installation steps --- config.fish | 1 + install/common.sh | 45 +++++++++++++++------------------------------ install/fish.sh | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 50 insertions(+), 30 deletions(-) create mode 100644 config.fish create mode 100755 install/fish.sh 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 <