From 7e8acc3f96c48f8c0d1c0ccbe9a31911f0a44955 Mon Sep 17 00:00:00 2001 From: askiiart Date: Wed, 13 Sep 2023 10:17:03 -0500 Subject: [PATCH] Add install-fish --- install-stuff/install-fish.bash | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 install-stuff/install-fish.bash diff --git a/install-stuff/install-fish.bash b/install-stuff/install-fish.bash new file mode 100755 index 0000000..42e06b1 --- /dev/null +++ b/install-stuff/install-fish.bash @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +set -e + +if [ $(whoami) == "root" ]; then + echo "Run as a normal user, not root" + exit 1 +fi + +command_exists() { type "$1" &>/dev/null; } + +if command_exists "apt-get"; then + sudo apt-get install fish -y +elif command_exists "yum"; then + sudo yum install fish -y +elif command_exists "pacman"; then + yay -S fish +elif command_exists "zypp"; then + # Untested + sudo zypper install fish -y +elif command_exists "emerge"; then + sudo echo Not yet supported, exiting... + exit +elif command_exists "apk"; then + sudo apk add fish +else + echo "Unsupported: unknown package manager and distro" + exit +fi + +chsh -s $(which fish) \ No newline at end of file