2023-09-13 10:17:03 -05:00
|
|
|
#!/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
|
2024-06-02 13:57:01 -05:00
|
|
|
sudo pacman -S fish
|
2023-09-13 10:17:03 -05:00
|
|
|
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
|
2024-04-17 21:41:40 -05:00
|
|
|
elif command_exists "xbps-install"; then
|
|
|
|
sudo xbps-install fish-shell -y
|
2023-09-13 10:17:03 -05:00
|
|
|
else
|
|
|
|
echo "Unsupported: unknown package manager and distro"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2023-11-23 16:03:11 -06:00
|
|
|
chsh -s $(readlink -f $(which fish))
|