Compare commits

..

No commits in common. "ccc68c56123c4988014822c52a58492f3ffae062" and "3713396153cc4f210a56d8ca48a6070540020860" have entirely different histories.

3 changed files with 72 additions and 54 deletions

View file

@ -39,7 +39,7 @@ getImports() {
} }
init_docker() { init_docker() {
if command_exists docker; then if command -v docker >/dev/null 2>&1; then
echo_info "Docker was installed correctly. Do you want to add $(whoami) to the docker group? (y/n)" echo_info "Docker was installed correctly. Do you want to add $(whoami) to the docker group? (y/n)"
read -r dgroup </dev/tty read -r dgroup </dev/tty
case "$dgroup" in case "$dgroup" in
@ -48,7 +48,7 @@ init_docker() {
;; ;;
esac esac
sleep 1 sleep 1
run $_sudo systemctl enable --now docker $_sudo systemctl enable --now docker
echo_info "$(whoami) is now part of the docker group. Restart your session to enable the changes. Also docker was addet as a service. Should autostart from now on." echo_info "$(whoami) is now part of the docker group. Restart your session to enable the changes. Also docker was addet as a service. Should autostart from now on."
else else
echo_error "Something went wrong!" echo_error "Something went wrong!"
@ -57,19 +57,19 @@ init_docker() {
_arch() { _arch() {
echo_info "executing arch" echo_info "executing arch"
sleep 1.3 sleep 2
run _install docker docker-compose --noconfirm _install docker docker-compose --noconfirm
} }
_debian() { _debian() {
if ! $trixie; then if ! $trixie; then
echo_info "executing debian" echo_info "executing debian"
sleep 1.3 sleep 2
run $_sudo apt-get update && $_sudo apt-get update &&
run $_sudo apt-get install -y ca-certificates curl && $_sudo apt-get install -y ca-certificates curl &&
run $_sudo install -m 0755 -d /etc/apt/keyrings && $_sudo install -m 0755 -d /etc/apt/keyrings &&
run $_sudo curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc && $_sudo curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc &&
run $_sudo chmod a+r /etc/apt/keyrings/docker.asc && $_sudo chmod a+r /etc/apt/keyrings/docker.asc &&
sleep 0.5 sleep 0.5
if [ "$VERSION_CODENAME" == "trixie" ]; then if [ "$VERSION_CODENAME" == "trixie" ]; then
VERSION_CODENAME="bookworm" VERSION_CODENAME="bookworm"
@ -79,37 +79,37 @@ _debian() {
echo_info "Addet repository. Updating and installing now.." echo_info "Addet repository. Updating and installing now.."
sleep 1 sleep 1
run $_sudo apt-get update $_sudo apt-get update
run checkAndInstall "docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin" checkAndInstall "docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin"
else else
echo_info "executing trixie.." echo_info "executing trixie.."
run _install docker.io docker-compose _install docker.io docker-compose
fi fi
} }
_ubuntu() { _ubuntu() {
echo_info "executing ubuntu" echo_info "executing ubuntu"
sleep 2 sleep 2
run $_sudo apt-get update && $_sudo apt-get update &&
run $_sudo apt-get install -y ca-certificates curl && $_sudo apt-get install -y ca-certificates curl &&
run $_sudo install -m 0755 -d /etc/apt/keyrings && $_sudo install -m 0755 -d /etc/apt/keyrings &&
run $_sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc && $_sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc &&
run $_sudo chmod a+r /etc/apt/keyrings/docker.asc $_sudo chmod a+r /etc/apt/keyrings/docker.asc
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \ echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | $_sudo tee /etc/apt/sources.list.d/docker.list >/dev/null $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | $_sudo tee /etc/apt/sources.list.d/docker.list >/dev/null
echo_info "Addet repository. Updating and installing now.." echo_info "Addet repository. Updating and installing now.."
sleep 0.5 sleep 0.5
run $_sudo apt-get update $_sudo apt-get update
run checkAndInstall "docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin" checkAndInstall "docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin"
} }
_fedora() { _fedora() {
echo_info "executing fedora" echo_info "executing fedora"
sleep 2 sleep 2
run _install dnf-plugins-core _install dnf-plugins-core
run $_sudo dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo $_sudo dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo
run checkAndInstall "docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin" checkAndInstall "docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin"
} }
main() { main() {
@ -125,15 +125,25 @@ main() {
if getImports; then if getImports; then
case "$1" in case "$1" in
--silent | -s) --silent | -s)
silent=true echo_warning "Executing silently!"
echo_warning "Running the script silently.." echo_info "Executing $distro"
;; case "$distro" in
arch) silentexec _arch ;;
debian) silentexec _debian ;;
ubuntu) silentexec _ubuntu ;;
fedora) silentexec _fedora ;;
*) *)
silent=false echo "$distro is not supported by this script"
exit 1
;; ;;
esac esac
init_docker
;;
*)
if main; then if main; then
init_docker init_docker
fi fi
;;
esac
fi fi

View file

@ -36,6 +36,14 @@ getImports() {
rm "$import" rm "$import"
} }
run(){
if $silent; then
silentexec "$@"
else
"$@"
fi
}
askThings() { askThings() {
echo_note "Do you want to install hyprland? (y/N)" echo_note "Do you want to install hyprland? (y/N)"
read -r askHyprland </dev/tty read -r askHyprland </dev/tty
@ -92,16 +100,17 @@ instCustom() {
waybar) checkAndInstall waybar ;; waybar) checkAndInstall waybar ;;
hyprpanel) hyprpanel)
case $distro in case $distro in
arch) run _install ags-hyprpanel-git ;; arch) _install ags-hyprpanel-git ;;
*) echo_error "Hyprpanel cannot be installed for ${YELLOW}${distro}${RED} right now.." ;; *) echo_error "Hyprpanel cannot be installed for ${YELLOW}${distro}${RED} right now.." ;;
esac esac
;; ;;
gBar) gBar)
case $distro in case $distro in
arch) run _install gbar-git ;; arch) _install gbar-git ;;
*) echo_error "gBar cannot be installed for ${YELLOW}${distro}${RED} right now.." ;; *) echo_error "gBar cannot be installed for ${YELLOW}${distro}${RED} right now.." ;;
esac esac
;; ;;
;;
esac esac
} }
@ -111,12 +120,12 @@ cloneDotfiles() {
case "$askDotfiles2" in case "$askDotfiles2" in
[pP]) [pP])
echo_info "Cloning pika's config..." echo_info "Cloning pika's config..."
run git clone --recursive --depth=1 https://git.k4li.de/dotfiles/hyprdots.git "$HOME/git/hyprdots" || { echo_error "Failed to clone dotfiles!" && exit 1; } git clone --recursive --depth=1 https://git.k4li.de/dotfiles/hyprdots.git $HOME/git/hyprdots || echo_error "Failed to clone dotfiles!" && exit 1
cd $HOME/git/hyprdots || { echo_error "Failed to clone dotfiles!" && exit 1; } cd $HOME/git/hyprdots || echo_error "Failed to clone dotfiles!" && exit 1
echo_info "Installing dotfiles..." echo_info "Installing dotfiles..."
make </dev/tty || { echo_error "Failed to install dotfiles!" && exit 1; } make </dev/tty || echo_error "Failed to install dotfiles!" && exit 1
echo_info "Dotfiles installed successfully!" echo_info "Dotfiles installed successfully!"
;; ;;
@ -124,7 +133,7 @@ cloneDotfiles() {
echo_info "Cloning dotfiles from $askDotfiles2..." echo_info "Cloning dotfiles from $askDotfiles2..."
git clone --recursive --depth=1 $askDotfiles2 $HOME/git/hyprdots git clone --recursive --depth=1 $askDotfiles2 $HOME/git/hyprdots
cd $HOME/git/hyprdots || { echo_error "Failed to clone dotfiles!" && exit 1; } cd $HOME/git/hyprdots || echo_error "Failed to clone dotfiles!" && exit 1
echo_info "Your dotfiles have been saved to $HOME/git/hyprdots" echo_info "Your dotfiles have been saved to $HOME/git/hyprdots"
echo_info "You can now install your dotfiles how you want to!" echo_info "You can now install your dotfiles how you want to!"

View file

@ -116,7 +116,6 @@
case "$1" in case "$1" in
--silent | -s) --silent | -s)
silent=true silent=true
echo_warning "Running the script silently.."
;; ;;
*) *)
silent=false silent=false