2023-12-17 00:20:33 +01:00
|
|
|
#!/bin/bash
|
2024-06-02 17:15:38 +02:00
|
|
|
# Check for sudo
|
2023-12-17 00:20:33 +01:00
|
|
|
if [ ! -f "/sbin/sudo" ]; then
|
2024-06-02 17:15:38 +02:00
|
|
|
echo ":: Error: \"/sbin/sudo\" not found, please install sudo"
|
2023-12-17 00:20:33 +01:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2024-06-02 17:15:38 +02:00
|
|
|
# Clear variables
|
|
|
|
#PACMAN_FLAGS=
|
2024-06-02 17:18:16 +02:00
|
|
|
INSTALL_GUI_PACKAGES=
|
2024-06-02 17:15:38 +02:00
|
|
|
|
|
|
|
# Parse arguments
|
|
|
|
for arg in "${@}"; do
|
2024-06-02 21:12:55 +02:00
|
|
|
case "${arg}" in
|
|
|
|
"--noconfirm")
|
|
|
|
# I don't know what shellcheck is seeing here...
|
|
|
|
# shellcheck disable=SC2037
|
|
|
|
PACMAN_FLAGS=${PACMAN_FLAGS} --noconfirm
|
|
|
|
;;
|
|
|
|
"--gui")
|
|
|
|
INSTALL_GUI_PACKAGES=true
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo ":: Warning: Unknown argument \"${arg}\""
|
|
|
|
esac
|
2024-06-02 17:15:38 +02:00
|
|
|
done
|
|
|
|
|
|
|
|
# Source /etc/os-release
|
2023-12-17 00:20:33 +01:00
|
|
|
echo ":: Detecting distribution"
|
|
|
|
if [ -f "/etc/os-release" ]; then
|
2024-06-02 17:15:38 +02:00
|
|
|
# shellcheck disable=SC1091
|
2023-12-17 00:20:33 +01:00
|
|
|
source /etc/os-release
|
|
|
|
fi
|
2024-06-02 17:15:38 +02:00
|
|
|
|
|
|
|
# Perform actions based on distro
|
2023-12-17 00:20:33 +01:00
|
|
|
case "$ID" in
|
2024-05-20 13:18:42 +02:00
|
|
|
"arch")
|
2024-06-02 17:15:38 +02:00
|
|
|
echo ":: Detected Arch Linux, installing packages automatically"
|
|
|
|
|
|
|
|
# Check for paru
|
2023-12-17 00:20:33 +01:00
|
|
|
if [ ! -f "/sbin/paru" ]; then
|
2024-06-02 17:15:38 +02:00
|
|
|
echo ":: Error: \"/sbin/paru\" not found, please install paru"
|
2023-12-17 00:20:33 +01:00
|
|
|
exit 1
|
|
|
|
fi
|
2024-06-02 17:15:38 +02:00
|
|
|
|
|
|
|
# Install required packages (command line)
|
|
|
|
# shellcheck disable=SC2086
|
|
|
|
paru --removemake --batchinstall --sudoloop --mflags "--ignorearch" -Syu --needed ${PACMAN_FLAGS} \
|
|
|
|
nano ncurses moar fireplace sl fortune-mod cowsay lolcat \
|
|
|
|
moar yt-dlp-git tar zstd bzip zip unrar unzip 7-zip \
|
|
|
|
rustup binutils base-devel
|
|
|
|
|
|
|
|
# Install required packages packages (graphical)
|
|
|
|
# shellcheck disable=SC2086
|
|
|
|
[[ -n "${INSTALL_GUI_PACKAGES}" ]] && \
|
|
|
|
paru --removemake --batchinstall --sudoloop --mflags "--ignorearch" -Syu --needed ${PACMAN_FLAGS} \
|
2024-06-02 22:45:45 +02:00
|
|
|
hyprland-git hyprpaper-git waybar fnott qt6ct bemenu-wayland \
|
2024-06-02 17:15:38 +02:00
|
|
|
cliphist j4-dmenu-desktop polkit-kde-agent polkit-qt6 \
|
2024-06-02 17:17:31 +02:00
|
|
|
xdg-desktop-portal-hyprland-git xdg-desktop-portal-kde \
|
2024-06-02 17:15:38 +02:00
|
|
|
qt6-wayland qt5-wayland xwaylandvideobridge pipewire \
|
|
|
|
wireplumber
|
|
|
|
|
|
|
|
# Install/update Rust toolchains and Rust-based software
|
|
|
|
(
|
|
|
|
# Update installed toolchains
|
|
|
|
rustup update
|
|
|
|
|
|
|
|
# Install nightly and stable toolchains
|
|
|
|
rustup install stable
|
|
|
|
rustup install nightly
|
|
|
|
|
|
|
|
# Switch to stable toolchain
|
2024-06-02 22:24:39 +02:00
|
|
|
rustup default nightly
|
2024-06-02 17:15:38 +02:00
|
|
|
|
|
|
|
# Install software
|
|
|
|
cargo install eza cargo-audit
|
|
|
|
)
|
|
|
|
|
|
|
|
# Install SDKMAN! and Java
|
|
|
|
(
|
|
|
|
# Download & install SDKMAN!
|
|
|
|
curl -s "https://get.sdkman.io" | bash
|
|
|
|
|
|
|
|
# Initialize SDKMAN! for subshell
|
|
|
|
export SDKMAN_DIR="$HOME/.sdkman"
|
|
|
|
# shellcheck disable=SC1091
|
|
|
|
[[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh"
|
|
|
|
|
|
|
|
# Update SDKMAN! and installed candidates
|
|
|
|
sdk selfupdate
|
|
|
|
sdk update
|
|
|
|
|
|
|
|
# Install Java versions specified in array
|
|
|
|
# We use the Temurin distribution of Java.
|
|
|
|
|
|
|
|
java_versions=( '22.0.1' '21.0.3' '17.0.11' '8.0.412' )
|
|
|
|
for version in "${java_versions[@]}"; do
|
|
|
|
sdk install java "${version}-tem"
|
|
|
|
done
|
|
|
|
|
|
|
|
# Default to Java 21
|
|
|
|
sdk default java 21.0.3-tem
|
|
|
|
)
|
|
|
|
|
|
|
|
# Install Hyprland plugins
|
|
|
|
(
|
|
|
|
# Install Hyprland headers & update existing plugins
|
|
|
|
hyprpm update
|
|
|
|
|
|
|
|
# Add hyprland-plugins repository
|
|
|
|
yes | hyprpm add https://github.com/hyprwm/hyprland-plugins
|
|
|
|
|
|
|
|
# Enable plugins
|
|
|
|
hyprpm enable csgo-vulkan-fix
|
|
|
|
)
|
|
|
|
|
2023-12-17 00:20:33 +01:00
|
|
|
;;
|
2024-05-20 13:18:42 +02:00
|
|
|
"archarm")
|
|
|
|
echo ":: Arch Linux ARM is not yet supported"
|
|
|
|
echo " (but will soon be). Just wait a little!"
|
2024-06-02 17:15:38 +02:00
|
|
|
|
2024-05-20 13:18:42 +02:00
|
|
|
;;
|
2023-12-17 00:20:33 +01:00
|
|
|
*)
|
2024-06-02 17:15:38 +02:00
|
|
|
echo ":: Hmm... your distribution isn't supported"
|
|
|
|
echo " You can do the following:"
|
|
|
|
echo " - Create an issue"
|
|
|
|
echo " - Look into the source for this script"
|
|
|
|
echo " and install the required software yourself"
|
|
|
|
|
2023-12-17 00:20:33 +01:00
|
|
|
;;
|
|
|
|
esac
|