Last active
December 7, 2023 06:18
-
-
Save HernandoR/f1d2f0be041c99bf0f7c1d0a53ac1ada to your computer and use it in GitHub Desktop.
Software install
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -L https://gist.githubusercontent.com/HernandoR/f1d2f0be041c99bf0f7c1d0a53ac1ada/raw/install-temianl-app.sh | |
curl -L https://gist.githubusercontent.com/HernandoR/f1d2f0be041c99bf0f7c1d0a53ac1ada/raw/install-desktop-app.sh | |
source ./install-temianl-app.sh | |
source ./install-desktop-app.sh | |
# Call the functions | |
detect_os | |
install_git | |
install_homebrew | |
install_build_essential | |
install_wget | |
install_curl | |
install_dnsutils | |
install_fira_code_nerd_font | |
install_xmake | |
install_build_essential | |
install_conda | |
install_lunarvim | |
install_nodejs_npm | |
# install_1password | |
# install_edge | |
# install_vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Function to detect the operating system | |
detect_os() { | |
if [[ "$OSTYPE" == "linux-gnu"* ]]; then | |
OS="Linux" | |
elif [[ "$OSTYPE" == "darwin"* ]]; then | |
OS="macOS" | |
elif [[ "$OSTYPE" == "cygwin" || "$OSTYPE" == "msys" || "$OSTYPE" == "win32" ]]; then | |
OS="Windows" | |
else | |
OS="Unknown" | |
fi | |
# Export the OS as a global variable | |
export OS | |
# Display the detected OS | |
echo "Detected OS: $OS" | |
} | |
# Function to install Homebrew or Linuxbrew | |
install_homebrew() { | |
if [[ "$OS" == "macOS" ]]; then | |
if ! command -v brew &> /dev/null; then | |
echo "Homebrew not found. Installing Homebrew..." | |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | |
else | |
echo "Homebrew is already installed." | |
fi | |
elif [[ "$OS" == "Linux" ]]; then | |
if ! command -v brew &> /dev/null; then | |
echo "Homebrew not found. Installing Linuxbrew..." | |
sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)" | |
else | |
echo "Linuxbrew is already installed." | |
fi | |
else | |
echo "Homebrew or Linuxbrew is not available for this operating system." | |
fi | |
} | |
# Function to install Fira Code Nerd Font | |
install_fira_code_nerd_font() { | |
echo "Installing Fira Code Nerd Font..." | |
git clone --depth 1 https://github.com/ryanoasis/nerd-fonts.git | |
cd nerd-fonts | |
./install.sh FiraCode | |
cd .. | |
rm -rf nerd-fonts | |
echo "Fira Code Nerd Font installation completed." | |
} | |
install_fontconfig() { | |
if [[ "$OS" != "Linux" ]]; then | |
echo "fontconfig is only supported on Linux" | |
return | |
fi | |
if command -v fc-cache > /dev/null 2>&1; then | |
echo "fontconfig is already installed" | |
else | |
echo "Installing fontconfig..." | |
if [[ -f /etc/os-release ]]; then | |
# Debian/Ubuntu | |
sudo apt-get update | |
sudo apt-get install -y fontconfig | |
elif [[ -f /etc/redhat-release ]]; then | |
# CentOS/RHEL | |
sudo yum install -y fontconfig | |
else | |
echo "Unable to install fontconfig on this Linux distro" | |
return 1 | |
fi | |
echo "fontconfig installed successfully" | |
fi | |
} | |
# Function to install xmake | |
install_xmake() { | |
echo "Installing xmake..." | |
if ! command -v xmake &> /dev/null; then | |
curl -fsSL https://xmake.io/shget.text | sh | |
else | |
echo "xmake is already installed." | |
fi | |
} | |
install_command_not_found() { | |
if [[ "$OS" != "Linux" ]]; then | |
echo "command-not-found is only supported on Linux" | |
return | |
fi | |
if command -v command-not-found > /dev/null 2>&1; then | |
echo "command-not-found is already installed" | |
else | |
echo "Installing command-not-found..." | |
if [[ -f /etc/os-release ]]; then | |
# Debian/Ubuntu | |
sudo apt-get update | |
sudo apt-get install -y command-not-found | |
elif [[ -f /etc/redhat-release ]]; then | |
# CentOS/RHEL | |
sudo yum install -y yum-utils | |
sudo yum install -y epel-release | |
sudo yum install -y command-not-found | |
else | |
echo "Unable to install command-not-found on this Linux distro" | |
return 1 | |
fi | |
echo "command-not-found installed successfully" | |
fi | |
install_git() { | |
echo "Installing git..." | |
if ! command -v git &> /dev/null; then | |
if [[ "$OS" == "macOS" ]]; then | |
brew install git | |
elif [[ "$OS" == "Linux" ]]; then | |
sudo apt-get update | |
sudo apt-get install git | |
else | |
echo "git installation is not supported for this operating system." | |
fi | |
else | |
echo "git is already installed." | |
fi | |
} | |
# Function to install build-essential | |
install_build_essential() { | |
echo "Installing build-essential..." | |
if [[ "$OS" == "macOS" ]]; then | |
xcode-select --install | |
elif [[ "$OS" == "Linux" ]]; then | |
sudo apt-get update | |
sudo apt-get install build-essential | |
else | |
echo "build-essential installation is not supported for this operating system." | |
fi | |
} | |
# Function to install wget | |
install_wget() { | |
echo "Installing wget..." | |
if ! command -v wget &> /dev/null; then | |
if [[ "$OS" == "macOS" ]]; then | |
brew install wget | |
elif [[ "$OS" == "Linux" ]]; then | |
sudo apt-get update | |
sudo apt-get install wget | |
else | |
echo "wget installation is not supported for this operating system." | |
fi | |
else | |
echo "wget is already installed." | |
fi | |
} | |
# Function to install curl | |
install_curl() { | |
echo "Installing curl..." | |
if ! command -v curl &> /dev/null; then | |
if [[ "$OS" == "macOS" ]]; then | |
brew install curl | |
elif [[ "$OS" == "Linux" ]]; then | |
sudo apt-get update | |
sudo apt-get install curl | |
else | |
echo "curl installation is not supported for this operating system." | |
fi | |
else | |
echo "curl is already installed." | |
fi | |
} | |
# Function to install dnsutils | |
install_dnsutils() { | |
echo "Installing dnsutils..." | |
if [[ "$OS" == "macOS" ]]; then | |
brew install dnsutils | |
elif [[ "$OS" == "Linux" ]]; then | |
sudo apt-get update | |
sudo apt-get install dnsutils | |
else | |
echo "dnsutils installation is not supported for this operating system." | |
fi | |
} | |
# Function to install Conda | |
install_conda() { | |
echo "Installing Conda..." | |
if ! command -v conda &> /dev/null; then | |
curl -fsSL https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -o miniconda.sh | |
bash miniconda.sh -b -p $HOME/miniconda | |
rm miniconda.sh | |
else | |
echo "Conda is already installed." | |
fi | |
} | |
# Function to install LunarVim | |
install_lunarvim() { | |
echo "Installing LunarVim..." | |
if ! command -v lvim &> /dev/null; then | |
bash <(curl -s https://raw.githubusercontent.com/LunarVim/LunarVim/rolling/utils/installer/install.sh) | |
else | |
echo "LunarVim is already installed." | |
fi | |
} | |
# Function to install Node.js and npm | |
install_nodejs_npm() { | |
echo "Installing Node.js and npm..." | |
if ! command -v node &> /dev/null || ! command -v npm &> /dev/null; then | |
if [[ "$OS" == "macOS" ]]; then | |
brew install node | |
elif [[ "$OS" == "Linux" ]]; then | |
curl -fsSL https://deb.nodesource.com/setup_14.x | sudo -E bash - | |
sudo apt-get install -y nodejs | |
else | |
echo "Node.js and npm installation is not supported for this operating system." | |
fi | |
else | |
echo "Node.js and npm are already installed." | |
fi | |
} | |
install_nvim() { | |
echo "Installing nvim..." | |
if ! command -v nvim &> /dev/null then | |
if [[ "$OS" == "macOS" ]]; then | |
brew install neovim | |
elif [[ "$OS" == "Linux" ]]; then | |
brew install neovim | |
else | |
echo "nvim installation is not supported for this operating system." | |
fi | |
else | |
echo "nvim is already installed." | |
fi | |
} | |
install_lunarvim() { | |
echo "Installing lunarvim..." | |
if ! command -v lvim &> /dev/null then | |
install_nvim | |
if [[ "$OS" == "macOS" ]]; then | |
brew install lunarvim | |
elif [[ "$OS" == "Linux" ]]; then | |
LV_BRANCH='release-1.3/neovim-0.9' bash <(curl -s https://raw.githubusercontent.com/LunarVim/LunarVim/release-1.3/neovim-0.9/utils/installer/install.sh) | |
else | |
echo "lvim installation is not supported for this operating system." | |
fi | |
else | |
echo "lvim is already installed." | |
fi | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Check if running as root | |
if [ "$EUID" -ne 0 ]; then | |
echo "Please run as root" | |
exit | |
fi | |
# Function to install VS Code | |
install_vscode() { | |
# Ubuntu | |
if [[ -n "$(command -v apt)" ]]; then | |
sudo apt update | |
sudo apt install -y code | |
# openSUSE | |
elif [[ -n "$(command -v zypper)" ]]; then | |
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc | |
sudo zypper addrepo https://packages.microsoft.com/yumrepos/vscode vscode | |
sudo zypper refresh | |
sudo zypper install code | |
# Arch Linux | |
elif [[ -n "$(command -v pacman)" ]]; then | |
sudo pacman -Syu --noconfirm code | |
fi | |
} | |
# Function to install Microsoft Edge | |
install_edge() { | |
# Ubuntu | |
if [[ -n "$(command -v apt)" ]]; then | |
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg | |
install -o root -g root -m 644 microsoft.gpg /etc/apt/trusted.gpg.d/ | |
sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/edge stable main" > /etc/apt/sources.list.d/microsoft-edge-dev.list' | |
rm microsoft.gpg | |
apt update | |
apt install -y microsoft-edge-stable | |
# openSUSE | |
elif [[ -n "$(command -v zypper)" ]]; then | |
sudo zypper addrepo https://packages.microsoft.com/yumrepos/edge microsoft-edge | |
sudo zypper --gpg-auto-import-keys refresh -y | |
sudo zypper install -y microsoft-edge-stable | |
# Arch Linux | |
elif [[ -n "$(command -v pacman)" ]]; then | |
echo "[microsoft-edge-stable]" >> /etc/pacman.conf | |
echo "Server = https://packages.microsoft.com/repos/edge/stable/community" >> /etc/pacman.conf | |
pacman -Syu --noconfirm microsoft-edge-stable | |
fi | |
} | |
# Function to install 1Password | |
install_1password() { | |
# Ubuntu | |
if [[ -n "$(command -v apt)" ]]; then | |
curl -sS https://downloads.1password.com/linux/keys/1password.asc | sudo gpg --dearmor --output /usr/share/keyrings/1password-archive-keyring.gpg | |
echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/1password-archive-keyring.gpg] https://downloads.1password.com/linux/debian/amd64 stable main' | sudo tee /etc/apt/sources.list.d/1password.list | |
sudo apt update && sudo apt -y install 1password | |
# openSUSE | |
elif [[ -n "$(command -v zypper)" ]]; then | |
sudo rpm --import https://downloads.1password.com/linux/keys/1password.asc | |
sudo zypper ar https://downloads.1password.com/linux/rpm/stable/x86_64 1password | |
sudo zypper install -y 1password | |
# Arch Linux | |
elif [[ -n "$(command -v pacman)" ]]; then | |
echo "[1password]" >> /etc/pacman.conf | |
echo "Server = https://downloads.1password.com/linux/arch/\$arch" >> /etc/pacman.conf | |
pacman -Syu --noconfirm 1password | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment