From 4fea3df1cd65905c542e718a2d494eb937df0a53 Mon Sep 17 00:00:00 2001 From: Stephan Raabe Date: Thu, 23 May 2024 14:00:01 +0200 Subject: [PATCH] Updates --- .install/confirm-start.sh | 1 - .install/paralleldownloads.sh | 40 +++++++++++++++++++++++++++++++++++ .install/updatesystem.sh | 2 +- README.md | 1 + install.sh | 1 + scripts/bravebookmarks.sh | 15 ------------- scripts/calculator.sh | 12 ----------- 7 files changed, 43 insertions(+), 29 deletions(-) create mode 100755 .install/paralleldownloads.sh delete mode 100755 scripts/bravebookmarks.sh delete mode 100755 scripts/calculator.sh diff --git a/.install/confirm-start.sh b/.install/confirm-start.sh index db66c1a..c370a90 100644 --- a/.install/confirm-start.sh +++ b/.install/confirm-start.sh @@ -2,7 +2,6 @@ # Confirm Start # ------------------------------------------------------ -echo "You can cancel the installation at any time with CTRL + C" SCRIPT=$(realpath "$0") SCRIPTPATH=$(dirname "$SCRIPT") if [ $SCRIPTPATH = "/home/$USER/dotfiles" ]; then diff --git a/.install/paralleldownloads.sh b/.install/paralleldownloads.sh new file mode 100755 index 0000000..d4958f4 --- /dev/null +++ b/.install/paralleldownloads.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# ------------------------------------------------------ +# Activate parallel downloads +# ------------------------------------------------------ +# Search for the line containing "ParallelDownloads = 5" +line=$(grep "ParallelDownloads = 5" /etc/pacman.conf) + +# Check if the line starts with a '#' character +if [[ $line == \#* ]]; then + echo -e "${GREEN}" + figlet "Downloads" + echo -e "${NONE}" + echo ":: You can activate 5 parallel downloads in pacman.conf to speedup the download of the packages?" + if gum confirm "Do you want to activate parallel downloads?"; then + + # Remove the '#' character from the beginning of the line + echo ":: Modifying pacman.conf to enable parallel downloads." + new_line=$(echo $line | sed 's/^#//') + + # Replace the original line with the new line in the configuration file + sudo sed -i "s/$line/$new_line/g" /etc/pacman.conf + + # Display a message indicating that the line was modified + echo ":: Modified line: $new_line" + elif [ $? -eq 130 ]; then + exit + else + echo ":: Activation of parallel downloads skipped." + fi +else + # Check if the line is already uncommented + if [[ $line == ParallelDownloads\ =\ 5 ]]; then + # Display a message indicating that the line does not need to be modified + echo ":: pacman.conf already optimized for parallel downloads." + else + # Display a message indicating that the line is missing or commented out + echo ":: Parallel downloads could not be activated. Required configuration in /etc/pacman.conf could not found." + fi +fi +echo \ No newline at end of file diff --git a/.install/updatesystem.sh b/.install/updatesystem.sh index e3891a7..7ecdb9a 100644 --- a/.install/updatesystem.sh +++ b/.install/updatesystem.sh @@ -11,7 +11,7 @@ if gum confirm "Do you want to update your system with yay now?" ;then yay elif [ $? -eq 130 ]; then exit 130 -else +else echo ":: System update skipped" fi echo diff --git a/README.md b/README.md index 73164fb..6ff6dc0 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,7 @@ The dotfiles are tested with the following Arch based distributions: - Arch Linux (recommended) - EndeavourOS +- Manjaro Linux - Garuda Linux - Arco Linux diff --git a/install.sh b/install.sh index 6ab23e3..b4df667 100755 --- a/install.sh +++ b/install.sh @@ -35,6 +35,7 @@ fi echo "" source .install/required.sh source .install/confirm-start.sh +source .install/paralleldownloads.sh source .install/yay.sh source .install/updatesystem.sh source .install/backup.sh diff --git a/scripts/bravebookmarks.sh b/scripts/bravebookmarks.sh deleted file mode 100755 index 1784c39..0000000 --- a/scripts/bravebookmarks.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -# ____ _ _ -# | __ ) ___ ___ | | ___ __ ___ __ _ _ __| | _____ -# | _ \ / _ \ / _ \| |/ / '_ ` _ \ / _` | '__| |/ / __| -# | |_) | (_) | (_) | <| | | | | | (_| | | | <\__ \ -# |____/ \___/ \___/|_|\_\_| |_| |_|\__,_|_| |_|\_\___/ -# -# by Stephan Raabe (2023) -# ----------------------------------------------------- - -selected=$(cat ~/.config/BraveSoftware/Brave-Browser/Default/Bookmarks | grep '"url":' | awk '{print $2}' | sed 's/"//g' | rofi -dmenu -p "Select a Brave Bookmark") - -if [ "$selected" ]; then - brave $selected -fi diff --git a/scripts/calculator.sh b/scripts/calculator.sh deleted file mode 100755 index de14ba7..0000000 --- a/scripts/calculator.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -# ____ _ _ _ -# / ___|__ _| | ___ _ _| | __ _| |_ ___ _ __ -# | | / _` | |/ __| | | | |/ _` | __/ _ \| '__| -# | |__| (_| | | (__| |_| | | (_| | || (_) | | -# \____\__,_|_|\___|\__,_|_|\__,_|\__\___/|_| -# -# -# by Stephan Raabe (2023) -# ----------------------------------------------------- - -rofi -show calc