247 lines
7.3 KiB
Bash
Executable File
247 lines
7.3 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
# Helper methods, actual script starts at line :110
|
|
|
|
deb_install() {
|
|
file=$1
|
|
path=~/Downloads/$1
|
|
url=$2
|
|
download_file $file $url \
|
|
&& __install_deb
|
|
}
|
|
|
|
deb_git_install() {
|
|
file=$1
|
|
path=~/Downloads/$1
|
|
repo=$2
|
|
regex=$3
|
|
download_git_release $file $repo $regex \
|
|
&& __install_deb
|
|
}
|
|
|
|
__install_deb() {
|
|
sudo apt -f install $path \
|
|
&& rm $path
|
|
}
|
|
|
|
tar_install() {
|
|
file=$1
|
|
path=~/Downloads/$2
|
|
url=$3
|
|
strip="${4:-1}" # If no strip param is given assume a strip level of 1
|
|
is_proper="${5:-"false"}"
|
|
download_file $file $url \
|
|
&& __install_tar $is_proper
|
|
}
|
|
|
|
tar_git_install() {
|
|
file=$1
|
|
path=~/Downloads/$2
|
|
repo=$3
|
|
regex=$4
|
|
strip="${5:-1}" # If no strip param is given assume a strip level of 1
|
|
is_proper="${6:-"false"}"
|
|
download_git_release $file $repo $regex \
|
|
&& __install_tar $is_proper
|
|
}
|
|
|
|
__install_tar() {
|
|
is_proper=$1
|
|
output=~/.local/lib/$file
|
|
if [ "$is_proper" = "true" ]; then
|
|
output=~/.local
|
|
fi
|
|
mkdir -p ~/.local/lib/$file \
|
|
&& mkdir -p ~/.local/bin \
|
|
&& tar -xaf $path -C $output --strip-components=$strip \
|
|
&& rm $path \
|
|
&& if [ "$is_proper" = "false" ]; then __link_lib_binary; fi
|
|
}
|
|
|
|
__link_lib_binary() {
|
|
if [ -s ~/.local/lib/$file/$file ]; then
|
|
ln -s ~/.local/lib/$file/$file ~/.local/bin/$file
|
|
elif [ -s ~/.local/lib/$file/bin/$file ]; then
|
|
ln -s ~/.local/lib/$file/bin/$file ~/.local/bin/$file
|
|
else
|
|
echo "No binary found!" 1>&2
|
|
fi
|
|
}
|
|
|
|
java_install() {
|
|
archive=~/Downloads/java-$1.tar.gz
|
|
download_git_release "java-${1}.tar.gz" "adoptium/temurin${1}-binaries" "OpenJDK${1}U-jdk_x64_linux_hotspot_.*tar\.gz" \
|
|
&& sudo mkdir /usr/lib/jvm/java-$1-temurin \
|
|
&& sudo tar -xf $archive -C /usr/lib/jvm/java-$1-temurin --strip-components 1 \
|
|
&& rm $archive
|
|
}
|
|
|
|
asdf_plugin() {
|
|
plugin=$1
|
|
version="${2:-latest}"
|
|
asdf plugin add $plugin \
|
|
&& asdf install $plugin $version \
|
|
&& asdf global $plugin $version
|
|
}
|
|
|
|
download_git_release() {
|
|
file=$1
|
|
repo=$2
|
|
regex=$3
|
|
get_git_release_url $repo $regex \
|
|
&& download_file $file $url
|
|
}
|
|
|
|
download_file() {
|
|
path=~/Downloads/$1
|
|
url=$2
|
|
wget --show-progress -qO $path $url
|
|
}
|
|
|
|
get_git_release_url() {
|
|
repo=$1
|
|
regex=$2
|
|
url=$(curl -s https://api.github.com/repos/$repo/releases/latest \
|
|
| grep "browser_download_url.*${regex}\"" \
|
|
| cut -d : -f 2,3 \
|
|
| tr -d \")
|
|
}
|
|
|
|
# Actual install list
|
|
|
|
# Mostly for wine
|
|
sudo dpkg --add-architecture i386
|
|
|
|
# GPG Keys
|
|
sudo wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key # wine
|
|
|
|
# Adding Repositories
|
|
sudo mkdir -pm755 /etc/apt/keyrings
|
|
sudo add-apt-repository -y universe
|
|
sudo wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key
|
|
|
|
sudo apt update -yqq
|
|
|
|
export PATH=$PATH:/home/$USER/.local/bin
|
|
|
|
# Core
|
|
packages="make coreutils git apt-transport-https ca-certificates curl wget gnupg lsb-release coreutils sed build-essential \
|
|
firefox git python3-pip zsh mpv figlet lolcat sqlitebrowser flatpak nala \
|
|
ffmpeg libavcodec58 libavcodec-extra ubuntu-restricted-extras \
|
|
gnome-shell-extensions gnome-tweak-tool gnome-menus gnome-user-share dconf-editor gparted alacarte \
|
|
nemo nemo-fileroller nemo-gtkhash \
|
|
pavucontrol gimp inkscape flameshot \
|
|
steam ckb-next lutris discord wine-devel winetricks \
|
|
qemu qemu-kvm virt-manager
|
|
"
|
|
# Bit crude but it works and if there's any package that cannot be installed it won't fail the entire list
|
|
# This _might_ be an apt only issue since -m / --ignore-missing flag doesn't seem to work
|
|
# will update if I ever switch to a different package manager
|
|
for pkg in $packages; do
|
|
sudo apt install -yqqm $pkg
|
|
done
|
|
|
|
sudo apt upgrade -yqq
|
|
|
|
# Set ZSH as default
|
|
chsh -s $(which zsh)
|
|
|
|
# QEMU / VMM
|
|
sudo usermod -aG libvirt,kvm $USER
|
|
|
|
# Flatpak
|
|
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
|
|
packages="flathub com.github.tchx84.Flatseal \
|
|
com.github.Eloston.UngoogledChromium \
|
|
org.prismlauncher.PrismLauncher \
|
|
com.github.finefindus.eyedropper \
|
|
com.usebottles.bottles \
|
|
com.obsproject.Studio \
|
|
org.qbittorrent.qBittorrent \
|
|
io.bassi.Amberol \
|
|
org.kde.kdenlive
|
|
"
|
|
# Same as above but this time there aint even a broken flag for it, it just hard fails at the first
|
|
# wrong package, why do people like flatpaks ?
|
|
for pkg in $packages; do
|
|
flatpak install -yu $pkg
|
|
done
|
|
|
|
# Cargo
|
|
# Note, cargo doesn't have the above issue, if a package is not found, it just skips it
|
|
# and tells you a package failed to install, yet another reason why rust is superior
|
|
curl https://sh.rustup.rs -sSf | sh
|
|
cargo install -q onefetch eza fd-find tokei alacritty stylua git-delta du-dust \
|
|
mdbook mdbook-admonish mdbook-tera stylua dprint
|
|
cargo install --features lsp taplo-cli
|
|
rustup component add rust-src rust-analyzer
|
|
|
|
# DEB Installs
|
|
deb_install Insomnia.deb "https://updates.insomnia.rest/downloads/ubuntu/latest?&app=com.insomnia.app&source=website"
|
|
deb_install OnlyOffice.deb "https://download.onlyoffice.com/install/desktop/editors/linux/onlyoffice-desktopeditors_amd64.deb"
|
|
deb_install JDGUI.deb "https://github.com/java-decompiler/jd-gui/releases/download/v1.6.6/jd-gui-1.6.6.deb"
|
|
deb_install Minecraft.deb "https://launcher.mojang.com/download/Minecraft.deb"
|
|
deb_git_install fastfetch.deb "fastfetch-cli/fastfetch" "fastfetch-linux-amd64.deb"
|
|
|
|
# TAR Installs
|
|
# Zig's case is special mostly because they don't have the 0.13 builds on github so no tar_git_install for that sadly
|
|
tar_install "zig" "zig.tar.xz" "https://ziglang.org/builds/zig-linux-x86_64-0.13.0-dev.340+d750a78b2.tar.xz"
|
|
tar_install "nvim" "nvim.tar.xz" "https://github.com/neovim/neovim/releases/download/v0.10.0/nvim-linux64.tar.gz" 1 "true"
|
|
tar_git_install "btop" "btop.tbz" "aristocratos/btop" "btop-x86_64-linux-musl.tbz" 2
|
|
|
|
# asdf
|
|
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.14.0
|
|
. ~/.asdf/asdf.sh
|
|
asdf_plugin nodejs
|
|
asdf_plugin lua-language-server
|
|
|
|
# npm global installs
|
|
npm i -g bash-language-server vscode-langservers-extracted pyright prettier sass
|
|
|
|
# pip installs
|
|
pip install --user ruff
|
|
|
|
# Antigen
|
|
curl -L git.io/antigen > ~/antigen.zsh
|
|
|
|
# Starship prompt
|
|
curl -sS https://starship.rs/install.sh | sh
|
|
|
|
# Nerd Fonts
|
|
wget -qO ~/Downloads/FiraCode.zip https://github.com/ryanoasis/nerd-fonts/releases/download/v3.2.1/FiraCode.zip
|
|
unzip ~/Downloads/FiraCode.zip "*.ttf" "*.otf" -d ${HOME}/.fonts
|
|
wget -qO ~/Downloads/JetBrainsMono.zip https://github.com/ryanoasis/nerd-fonts/releases/download/v3.2.1/JetBrainsMono.zip
|
|
unzip ~/Downloads/JetBrainsMono.zip "*.ttf" "*.otf" -d ${HOME}/.fonts
|
|
sudo fc-cache -f -v
|
|
|
|
# Special font for figlet
|
|
sudo wget -O "/usr/share/figlet/Red Phoenix.flf" "https://raw.githubusercontent.com/xero/figlet-fonts/master/Red%20Phoenix.flf"
|
|
|
|
# Docker
|
|
wget -O ~/Downloads/getdocker.sh "https://get.docker.com" \
|
|
&& chmod u+x ~/Downloads/getdocker.sh \
|
|
&& ~/Downloads/getdocker.sh \
|
|
&& sudo groupadd docker \
|
|
&& sudo usermod -aG docker $USER \
|
|
&& sudo systemctl enable docker.service containerd.service \
|
|
&& rm ~/Downloads/getdocker.sh
|
|
|
|
# Java
|
|
sudo mkdir -p /usr/lib/jvm
|
|
java_install 8
|
|
java_install 17
|
|
java_install 21
|
|
|
|
# Set Nemo as default
|
|
xdg-mime default nemo.desktop inode/directory application/x-gnome-saved-search
|
|
gsettings set org.gnome.desktop.default-applications.terminal exec terminator
|
|
gsettings set org.cinnamon.desktop.default-applications.terminal exec terminator
|
|
|
|
# Disable automated sleep (only for desktop and plugged in laptops)
|
|
gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type 'nothing'
|
|
|
|
if [ -e "./dot.py" ]; then
|
|
./dot.py --deploy
|
|
fi
|
|
|