From 7183d7cf20d6b4e2e3db9cb31b75f289c6ce4365 Mon Sep 17 00:00:00 2001 From: Chris Titus Date: Mon, 23 Sep 2024 11:42:29 -0500 Subject: [PATCH 01/15] fix autologin display .desktop is NOT needed --- core/tabs/utils/auto-login.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/tabs/utils/auto-login.sh b/core/tabs/utils/auto-login.sh index 3337bbf41..3571f74f5 100644 --- a/core/tabs/utils/auto-login.sh +++ b/core/tabs/utils/auto-login.sh @@ -29,7 +29,7 @@ list_sessions() { 8) session="openbox.desktop" ;; 9) session="i3.desktop" ;; 10) - printf "%b" "Enter custom session name (e.g., mysession.desktop): " + printf "%b" "Enter custom session name (e.g., mysession): " read -r session ;; *) printf "%b\n" "Invalid option selected." From afd3a30efb4a0a56297b2185f8dcdca6929bd59a Mon Sep 17 00:00:00 2001 From: Chris Titus Date: Mon, 23 Sep 2024 13:43:23 -0500 Subject: [PATCH 02/15] dwm fixes --- .../tabs/applications-setup/dwmtitus-setup.sh | 53 ++++--------------- 1 file changed, 9 insertions(+), 44 deletions(-) diff --git a/core/tabs/applications-setup/dwmtitus-setup.sh b/core/tabs/applications-setup/dwmtitus-setup.sh index 40f66d53c..c1e7439af 100755 --- a/core/tabs/applications-setup/dwmtitus-setup.sh +++ b/core/tabs/applications-setup/dwmtitus-setup.sh @@ -6,14 +6,14 @@ setupDWM() { printf "%b\n" "${YELLOW}Installing DWM-Titus...${RC}" case "$PACKAGER" in # Install pre-Requisites pacman) - "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm base-devel libx11 libxinerama libxft imlib2 libxcb git unzip flameshot lxappearance feh + "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm base-devel libx11 libxinerama libxft imlib2 libxcb git unzip flameshot lxappearance feh mate-polkit ;; apt-get|nala) - "$ESCALATION_TOOL" "$PACKAGER" install -y build-essential libx11-dev libxinerama-dev libxft-dev libimlib2-dev libx11-xcb-dev libfontconfig1 libx11-6 libxft2 libxinerama1 libxcb-res0-dev git unzip flameshot lxappearance feh + "$ESCALATION_TOOL" "$PACKAGER" install -y build-essential libx11-dev libxinerama-dev libxft-dev libimlib2-dev libx11-xcb-dev libfontconfig1 libx11-6 libxft2 libxinerama1 libxcb-res0-dev git unzip flameshot lxappearance feh mate-polkit ;; dnf) "$ESCALATION_TOOL" "$PACKAGER" groupinstall -y "Development Tools" - "$ESCALATION_TOOL" "$PACKAGER" install -y libX11-devel libXinerama-devel libXft-devel imlib2-devel libxcb-devel unzip flameshot lxappearance feh # no need to include git here as it should be already installed via "Development Tools" + "$ESCALATION_TOOL" "$PACKAGER" install -y libX11-devel libXinerama-devel libXft-devel imlib2-devel libxcb-devel unzip flameshot lxappearance feh mate-polkit # no need to include git here as it should be already installed via "Development Tools" ;; *) printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" @@ -66,6 +66,10 @@ install_nerd_font() { # Unzip the font file if it hasn't been unzipped yet if [ ! -d "$FONT_DIR/Meslo" ]; then + mkdir -p "$FONT_DIR/Meslo" || { + printf "%b\n" "${RED}Failed to create directory: $FONT_DIR/Meslo${RC}" + return 1 + } unzip "$FONT_ZIP" -d "$FONT_DIR" || { printf "%b\n" "${RED}Failed to unzip $FONT_ZIP${RC}" return 1 @@ -222,47 +226,7 @@ setupDisplayManager() { esac printf "%b\n" "${GREEN}$DM installed successfully${RC}" systemctl enable "$DM" - - # Prompt user for auto-login - # Using printf instead of echo -n as It's more posix-compliant. - printf "Do you want to enable auto-login? (Y/n) " - read -r answer - case "$answer" in - [Yy]*) - printf "%b\n" "${YELLOW}Configuring SDDM for autologin${RC}" - SDDM_CONF="/etc/sddm.conf" - if [ ! -f "$SDDM_CONF" ]; then - echo "[Autologin]" | "$ESCALATION_TOOL" tee -a "$SDDM_CONF" - echo "User=$USER" | "$ESCALATION_TOOL" tee -a "$SDDM_CONF" - echo "Session=dwm" | "$ESCALATION_TOOL" tee -a "$SDDM_CONF" - else - "$ESCALATION_TOOL" sed -i '/^\[Autologin\]/d' "$SDDM_CONF" - "$ESCALATION_TOOL" sed -i '/^User=/d' "$SDDM_CONF" - "$ESCALATION_TOOL" sed -i '/^Session=/d' "$SDDM_CONF" - echo "[Autologin]" | "$ESCALATION_TOOL" tee -a "$SDDM_CONF" - echo "User=$USER" | "$ESCALATION_TOOL" tee -a "$SDDM_CONF" - echo "Session=dwm" | "$ESCALATION_TOOL" tee -a "$SDDM_CONF" - fi - printf "%b\n" "{YELLOW}Checking if autologin group exists${RC}" - if ! getent group autologin > /dev/null; then - printf "%b\n" "${YELLOW}Creating autologin group${RC}" - "$ESCALATION_TOOL" groupadd autologin - else - printf "%b\n" "${GREEN}Autologin group already exists${RC}" - fi - printf "%b\n" "${YELLOW}Adding user with UID 1000 to autologin group${RC}" - USER_UID_1000=$(getent passwd 1000 | cut -d: -f1) - if [ -n "$USER_UID_1000" ]; then - "$ESCALATION_TOOL" usermod -aG autologin "$USER_UID_1000" - printf "%b\n" "${GREEN}User $USER_UID_1000 added to autologin group${RC}" - else - printf "%b\n" "${RED}No user with UID 1000 found - Auto login not possible${RC}" - fi - ;; - *) - printf "%b\n" "${GREEN}Auto-login configuration skipped${RC}" - ;; - esac + fi } @@ -291,5 +255,6 @@ setupDWM makeDWM install_slstatus install_nerd_font +picom_animations clone_config_folders configure_backgrounds From cd90bc0507a767c871c4eb2f3452311366067a46 Mon Sep 17 00:00:00 2001 From: Chris Titus Date: Mon, 23 Sep 2024 14:07:28 -0500 Subject: [PATCH 03/15] dwm fixes --- core/tabs/applications-setup/dwmtitus-setup.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/core/tabs/applications-setup/dwmtitus-setup.sh b/core/tabs/applications-setup/dwmtitus-setup.sh index c1e7439af..01ec0ef10 100755 --- a/core/tabs/applications-setup/dwmtitus-setup.sh +++ b/core/tabs/applications-setup/dwmtitus-setup.sh @@ -207,8 +207,14 @@ setupDisplayManager() { done printf "%b\n" "${GREEN}Current display manager: $currentdm${RC}" if [ "$currentdm" = "none" ]; then - DM="sddm" - printf "%b\n" "${YELLOW}No display manager found, installing $DM${RC}" + printf "%b\n" "${YELLOW}--------------------------${RC}" + printf "%b\n" "${YELLOW}Pick your Display Manager ${RC}" + printf "%b\n" "${YELLOW}1. SDDM ${RC}" + printf "%b\n" "${YELLOW}2. LightDM ${RC}" + printf "%b\n" "${YELLOW}3. GDM ${RC}" + printf "%b\n" "${YELLOW} ${RC}" + printf "%b" "${YELLOW}Please select one: ${RC}" + read -r DM case "$PACKAGER" in pacman) "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm "$DM" From 04d97e40763e4761c78aa4e08732e1ca07209365 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Jir=C3=A1k?= <77530871+JirakLu@users.noreply.github.com> Date: Sat, 28 Sep 2024 20:47:48 +0200 Subject: [PATCH 04/15] fix: multilib check in gaming setup (#689) --- core/tabs/system-setup/gaming-setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/tabs/system-setup/gaming-setup.sh b/core/tabs/system-setup/gaming-setup.sh index 0e2782b8c..1f88e93e6 100755 --- a/core/tabs/system-setup/gaming-setup.sh +++ b/core/tabs/system-setup/gaming-setup.sh @@ -9,7 +9,7 @@ installDepend() { case "$PACKAGER" in pacman) #Check for multilib - if ! grep -q "^\s*$$multilib$$" /etc/pacman.conf; then + if ! grep -q "^\s*\[multilib\]" /etc/pacman.conf; then echo "[multilib]" | "$ESCALATION_TOOL" tee -a /etc/pacman.conf echo "Include = /etc/pacman.d/mirrorlist" | "$ESCALATION_TOOL" tee -a /etc/pacman.conf "$ESCALATION_TOOL" "$PACKAGER" -Syu From 2e533cddf964a124de83d9dd74fd10160f0acb33 Mon Sep 17 00:00:00 2001 From: Adam Perkowski Date: Sat, 28 Sep 2024 20:52:51 +0200 Subject: [PATCH 05/15] Non-interactive `sh.rustup.rs`, DNF & `*` fixes (#669) --- core/tabs/applications-setup/linutil-installer.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/core/tabs/applications-setup/linutil-installer.sh b/core/tabs/applications-setup/linutil-installer.sh index 63f9f8363..28e180e0b 100755 --- a/core/tabs/applications-setup/linutil-installer.sh +++ b/core/tabs/applications-setup/linutil-installer.sh @@ -37,13 +37,17 @@ installLinutil() { pacman) "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm rustup ;; + dnf) + "$ESCALATION_TOOL" "$PACKAGER" install -y rustup + ;; zypper) "$ESCALATION_TOOL" "$PACKAGER" install -n curl gcc make - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y . $HOME/.cargo/env ;; *) - "$ESCALATION_TOOL" "$PACKAGER" install -y rustup + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y + . $HOME/.cargo/env ;; esac fi @@ -59,4 +63,4 @@ installLinutil() { checkEnv checkEscalationTool checkAURHelper -installLinutil \ No newline at end of file +installLinutil From 84a66c79d91d9aea63ad3c4060e98eaf9bffb43c Mon Sep 17 00:00:00 2001 From: Adam Perkowski Date: Sat, 28 Sep 2024 20:54:24 +0200 Subject: [PATCH 06/15] Fixed vscode on Arch (#663) --- core/tabs/applications-setup/Developer-tools/vscode-setup.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/tabs/applications-setup/Developer-tools/vscode-setup.sh b/core/tabs/applications-setup/Developer-tools/vscode-setup.sh index 539aac455..018616a65 100644 --- a/core/tabs/applications-setup/Developer-tools/vscode-setup.sh +++ b/core/tabs/applications-setup/Developer-tools/vscode-setup.sh @@ -21,7 +21,7 @@ installVsCode() { "$ESCALATION_TOOL" "$PACKAGER" --non-interactive install code ;; pacman) - "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm code + "$AUR_HELPER" -S --needed --noconfirm visual-studio-code-bin ;; dnf) "$ESCALATION_TOOL" rpm --import https://packages.microsoft.com/keys/microsoft.asc @@ -40,4 +40,5 @@ installVsCode() { checkEnv checkEscalationTool +checkAURHelper installVsCode From 2d1e45a41f4f42a99a91f2edab2c69f5ccd10ea8 Mon Sep 17 00:00:00 2001 From: Adam Perkowski Date: Sat, 28 Sep 2024 20:56:09 +0200 Subject: [PATCH 07/15] Fix AutoLogin `printf` and `>` issues (#662) * Fixed printf and tee errors * Fixed more * Changed to sed '' for BSD compatibility Co-authored-by: cartercanedy Co-authored-by: nnyyxxxx --------- Co-authored-by: cartercanedy Co-authored-by: nnyyxxxx --- core/tabs/utils/auto-login.sh | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/core/tabs/utils/auto-login.sh b/core/tabs/utils/auto-login.sh index 3571f74f5..561250d5d 100644 --- a/core/tabs/utils/auto-login.sh +++ b/core/tabs/utils/auto-login.sh @@ -43,9 +43,9 @@ configure_lightdm() { printf "%b" "Enter username for LightDM autologin: " read -r user - "$ESCALATION_TOOL" "printf '[Seat:*]' > /etc/lightdm/lightdm.conf.d/50-autologin.conf" - "$ESCALATION_TOOL" "printf 'autologin-user=$user' >> /etc/lightdm/lightdm.conf.d/50-autologin.conf" - "$ESCALATION_TOOL" "printf 'autologin-user-timeout=0' >> /etc/lightdm/lightdm.conf.d/50-autologin.conf" + printf "%b\n" '[Seat:*]' | "$ESCALATION_TOOL" tee -a /etc/lightdm/lightdm.conf + printf "%s\n" "autologin-user=$user" | "$ESCALATION_TOOL" tee -a /etc/lightdm/lightdm.conf + printf "%b\n" 'autologin-user-timeout=0' | "$ESCALATION_TOOL" tee -a /etc/lightdm/lightdm.conf printf "%b\n" "LightDM has been configured for autologin." } @@ -53,7 +53,8 @@ configure_lightdm() { # Function to remove LightDM autologin remove_lightdm_autologin() { printf "%b\n" "Removing LightDM autologin configuration..." - "$ESCALATION_TOOL" rm -f /etc/lightdm/lightdm.conf.d/50-autologin.conf + "$ESCALATION_TOOL" sed -i'' '/^\[Seat:\*]/d' /etc/lightdm/lightdm.conf + "$ESCALATION_TOOL" sed -i'' '/^autologin-/d' /etc/lightdm/lightdm.conf printf "%b\n" "LightDM autologin configuration has been removed." } @@ -63,9 +64,9 @@ configure_gdm() { printf "%b" "Enter username for GDM autologin: " read -r user - "$ESCALATION_TOOL" "printf '[daemon]' > /etc/gdm/custom.conf" - "$ESCALATION_TOOL" "printf 'AutomaticLoginEnable = true' >> /etc/gdm/custom.conf" - "$ESCALATION_TOOL" "printf 'AutomaticLogin = $user' >> /etc/gdm/custom.conf" + printf "%b\n" '[daemon]' | "$ESCALATION_TOOL" tee -a /etc/gdm/custom.conf + printf "%b\n" 'AutomaticLoginEnable = true' | "$ESCALATION_TOOL" tee -a /etc/gdm/custom.conf + printf "%s\n" "AutomaticLogin = $user" | "$ESCALATION_TOOL" tee -a /etc/gdm/custom.conf printf "%b\n" "GDM has been configured for autologin." } @@ -73,8 +74,8 @@ configure_gdm() { # Function to remove GDM autologin remove_gdm_autologin() { printf "%b\n" "Removing GDM autologin configuration..." - "$ESCALATION_TOOL" sed -i '/AutomaticLoginEnable/d' /etc/gdm/custom.conf - "$ESCALATION_TOOL" sed -i '/AutomaticLogin/d' /etc/gdm/custom.conf + "$ESCALATION_TOOL" sed -i'' '/AutomaticLoginEnable/d' /etc/gdm/custom.conf + "$ESCALATION_TOOL" sed -i'' '/AutomaticLogin/d' /etc/gdm/custom.conf printf "%b\n" "GDM autologin configuration has been removed." } @@ -85,9 +86,9 @@ configure_sddm() { read -r user list_sessions # Show session options - "$ESCALATION_TOOL" "printf '[Autologin]' > /etc/sddm.conf" - "$ESCALATION_TOOL" "printf 'User=$user' >> /etc/sddm.conf" - "$ESCALATION_TOOL" "printf 'Session=$session' >> /etc/sddm.conf" + printf "%b\n" '[Autologin]' | "$ESCALATION_TOOL" tee -a /etc/sddm.conf + printf "%s\n" "User=$user" | "$ESCALATION_TOOL" tee -a /etc/sddm.conf + printf "%s\n" "Session=$session" | "$ESCALATION_TOOL" tee -a /etc/sddm.conf printf "%b\n" "SDDM has been configured for autologin." } @@ -95,7 +96,7 @@ configure_sddm() { # Function to remove SDDM autologin remove_sddm_autologin() { printf "%b\n" "Removing SDDM autologin configuration..." - "$ESCALATION_TOOL" sed -i '/\[Autologin\]/,+2d' /etc/sddm.conf + "$ESCALATION_TOOL" sed -i'' '/\[Autologin\]/,+2d' /etc/sddm.conf printf "%b\n" "SDDM autologin configuration has been removed." } @@ -106,8 +107,8 @@ configure_lxdm() { read -r user list_sessions # Show session options - "$ESCALATION_TOOL" sed -i "s/^#.*autologin=.*$/autologin=${user}/" /etc/lxdm/lxdm.conf - "$ESCALATION_TOOL" sed -i "s|^#.*session=.*$|session=/usr/bin/${session}|; s|^session=.*$|session=/usr/bin/${session}|" /etc/lxdm/lxdm.conf + "$ESCALATION_TOOL" sed -i'' "s/^#.*autologin=.*$/autologin=${user}/" /etc/lxdm/lxdm.conf + "$ESCALATION_TOOL" sed -i'' "s|^#.*session=.*$|session=/usr/bin/${session}|; s|^session=.*$|session=/usr/bin/${session}|" /etc/lxdm/lxdm.conf printf "%b\n" "LXDM has been configured for autologin." } @@ -115,8 +116,8 @@ configure_lxdm() { # Function to remove LXDM autologin remove_lxdm_autologin() { printf "%b\n" "Removing LXDM autologin configuration..." - "$ESCALATION_TOOL" sed -i "s/^autologin=.*$/#autologin=/" /etc/lxdm/lxdm.conf - "$ESCALATION_TOOL" sed -i "s/^session=.*$/#session=/" /etc/lxdm/lxdm.conf + "$ESCALATION_TOOL" sed -i'' "s/^autologin=.*$/#autologin=/" /etc/lxdm/lxdm.conf + "$ESCALATION_TOOL" sed -i'' "s/^session=.*$/#session=/" /etc/lxdm/lxdm.conf printf "%b\n" "LXDM autologin configuration has been removed." } From c7622d8be7fef90b5d3d8b24c14707efaf3d600f Mon Sep 17 00:00:00 2001 From: Nightmare1984 <55515815+Nightmare1984@users.noreply.github.com> Date: Sat, 28 Sep 2024 14:59:41 -0400 Subject: [PATCH 08/15] updating Gaming For Fedora 41 (#681) * updating Gaming For Fedora 41 Red Hat Already Has OpenH264 Installed When You Update To Fedora 41 * Made Change's So Can Work With Fedora 41 And Older * Update core/tabs/system-setup/gaming-setup.sh Co-authored-by: Adam Perkowski * Update core/tabs/system-setup/gaming-setup.sh Co-authored-by: Nyx <144965845+nnyyxxxx@users.noreply.github.com> --------- Co-authored-by: Adam Perkowski Co-authored-by: Nyx <144965845+nnyyxxxx@users.noreply.github.com> --- core/tabs/system-setup/gaming-setup.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/core/tabs/system-setup/gaming-setup.sh b/core/tabs/system-setup/gaming-setup.sh index 1f88e93e6..86ad21aa1 100755 --- a/core/tabs/system-setup/gaming-setup.sh +++ b/core/tabs/system-setup/gaming-setup.sh @@ -36,9 +36,15 @@ installDepend() { "$ESCALATION_TOOL" "$PACKAGER" install -y "$DEPENDENCIES" "$DISTRO_DEPS" ;; dnf) - "$ESCALATION_TOOL" "$PACKAGER" install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm -y - "$ESCALATION_TOOL" "$PACKAGER" config-manager --enable fedora-cisco-openh264 -y - "$ESCALATION_TOOL" "$PACKAGER" install -y "$DEPENDENCIES" + if [ "$(rpm -E %fedora)" -le 41 ]; then + "$ESCALATION_TOOL" "$PACKAGER" install ffmpeg ffmpeg-libs -y + "$ESCALATION_TOOL" "$PACKAGER" install -y "$DEPENDENCIES" + else + printf "%b\n" "${CYAN}Fedora < 41 detected. Installing rpmfusion repos.${RC}" + "$ESCALATION_TOOL" "$PACKAGER" install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-"$(rpm -E %fedora)".noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-"$(rpm -E %fedora)".noarch.rpm -y + "$ESCALATION_TOOL" "$PACKAGER" config-manager --enable fedora-cisco-openh264 -y + "$ESCALATION_TOOL" "$PACKAGER" install -y "$DEPENDENCIES" + fi ;; zypper) "$ESCALATION_TOOL" "$PACKAGER" -n install "$DEPENDENCIES" From ce2d2d0ec9ff6e559c3f9e3559592d5ed28034b6 Mon Sep 17 00:00:00 2001 From: CarsBeck <140343231+CarsBeck@users.noreply.github.com> Date: Sat, 28 Sep 2024 15:00:20 -0400 Subject: [PATCH 09/15] Add descriptions to the Applications Setup section and Auto Mount Drive (#680) * Add description for Bottles * Add description for Auto Mount Drive * Add description for Docker * Add description for Grub Theme Setup --- core/tabs/applications-setup/tab_data.toml | 3 +++ core/tabs/utils/tab_data.toml | 1 + 2 files changed, 4 insertions(+) diff --git a/core/tabs/applications-setup/tab_data.toml b/core/tabs/applications-setup/tab_data.toml index f5ed12e5c..9af2ee4f2 100644 --- a/core/tabs/applications-setup/tab_data.toml +++ b/core/tabs/applications-setup/tab_data.toml @@ -110,6 +110,7 @@ task_list = "I FM" [[data]] name = "Bottles" +description = "Bottles allows Windows software, like applications and games, to run on Linux.\nBottles also provides tools to categorize, organize and optimize your applications." script = "bottles-setup.sh" task_list = "FI" @@ -127,6 +128,7 @@ task_list = "I PFM SS" [[data]] name = "Docker" +description = "Docker is an open platform that uses OS-level virtualization to deliver software in packages called containers." script = "docker-setup.sh" task_list = "I SS" @@ -144,6 +146,7 @@ task_list = "I" [[data]] name = "Grub Theme" +description = "Installs ChrisTitusTech's Top 5 Bootloader Themes script to allow for easy customization of GRUB." script = "grub-theme.sh" task_list = "PFM" diff --git a/core/tabs/utils/tab_data.toml b/core/tabs/utils/tab_data.toml index 4b6411471..7cfc3ed78 100644 --- a/core/tabs/utils/tab_data.toml +++ b/core/tabs/utils/tab_data.toml @@ -95,6 +95,7 @@ script = "user-account-manager/remove_from_group.sh" [[data]] name = "Auto Mount Drive" +description = "This utility is designed to help with automating the process of mounting a drive on to your system." script = "auto-mount.sh" task_list = "PFM" From 97b7d2860af518295c5c5dc6fb2dc3cc842633e2 Mon Sep 17 00:00:00 2001 From: plurpio <148961679+plurpio@users.noreply.github.com> Date: Sun, 29 Sep 2024 05:01:23 +1000 Subject: [PATCH 10/15] fix: do not hard depend on sudo being installed (#671) similar to #193 the checkCommandRequirements function under checkEnv hard-depended on sudo, although doas can be picked as an $ESCALATION_TOOL. --- core/tabs/common-script.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/tabs/common-script.sh b/core/tabs/common-script.sh index 25c5a71fa..b2c991b89 100644 --- a/core/tabs/common-script.sh +++ b/core/tabs/common-script.sh @@ -125,11 +125,11 @@ checkDistro() { } checkEnv() { - checkCommandRequirements 'curl groups sudo' + checkEscalationTool + checkCommandRequirements "curl groups $ESCALATION_TOOL" checkPackageManager 'nala apt-get dnf pacman zypper' checkCurrentDirectoryWritable checkSuperUser checkDistro - checkEscalationTool checkAURHelper } From a2480bf1bdc86ffc5ff685eb1b92589c6aa99083 Mon Sep 17 00:00:00 2001 From: cartercanedy <99052281+cartercanedy@users.noreply.github.com> Date: Sat, 28 Sep 2024 12:05:19 -0700 Subject: [PATCH 11/15] implement dynamic shortcut list sizing (#668) * implement dynamic shortcut list sizing * Remove all dynamic allocations from shortcut creation --- tui/src/float.rs | 6 +- tui/src/floating_text.rs | 27 +++---- tui/src/hint.rs | 151 ++++++++++--------------------------- tui/src/running_command.rs | 23 +++--- tui/src/state.rs | 125 ++++++++++++++++++++++++++---- 5 files changed, 175 insertions(+), 157 deletions(-) diff --git a/tui/src/float.rs b/tui/src/float.rs index 1f5b56c0a..1a12d6b1e 100644 --- a/tui/src/float.rs +++ b/tui/src/float.rs @@ -4,13 +4,13 @@ use ratatui::{ Frame, }; -use crate::hint::ShortcutList; +use crate::hint::Shortcut; pub trait FloatContent { fn draw(&mut self, frame: &mut Frame, area: Rect); fn handle_key_event(&mut self, key: &KeyEvent) -> bool; fn is_finished(&self) -> bool; - fn get_shortcut_list(&self) -> ShortcutList; + fn get_shortcut_list(&self) -> (&str, Box<[Shortcut]>); } pub struct Float { @@ -69,7 +69,7 @@ impl Float { } } - pub fn get_shortcut_list(&self) -> ShortcutList { + pub fn get_shortcut_list(&self) -> (&str, Box<[Shortcut]>) { self.content.get_shortcut_list() } } diff --git a/tui/src/floating_text.rs b/tui/src/floating_text.rs index 2cd638240..fefe9b9ad 100644 --- a/tui/src/floating_text.rs +++ b/tui/src/floating_text.rs @@ -4,10 +4,7 @@ use std::{ io::{Cursor, Read as _, Seek, SeekFrom, Write as _}, }; -use crate::{ - float::FloatContent, - hint::{Shortcut, ShortcutList}, -}; +use crate::{float::FloatContent, hint::Shortcut}; use linutil_core::Command; @@ -293,16 +290,16 @@ impl FloatContent for FloatingText { true } - fn get_shortcut_list(&self) -> ShortcutList { - ShortcutList { - scope_name: self.mode_title, - hints: vec![ - Shortcut::new(vec!["j", "Down"], "Scroll down"), - Shortcut::new(vec!["k", "Up"], "Scroll up"), - Shortcut::new(vec!["h", "Left"], "Scroll left"), - Shortcut::new(vec!["l", "Right"], "Scroll right"), - Shortcut::new(vec!["Enter", "p", "d", "g"], "Close window"), - ], - } + fn get_shortcut_list(&self) -> (&str, Box<[Shortcut]>) { + ( + self.mode_title, + Box::new([ + Shortcut::new("Scroll down", ["j", "Down"]), + Shortcut::new("Scroll up", ["k", "Up"]), + Shortcut::new("Scroll left", ["h", "Left"]), + Shortcut::new("Scroll right", ["l", "Right"]), + Shortcut::new("Close window", ["Enter", "p", "d", "g"]), + ]), + ) } } diff --git a/tui/src/hint.rs b/tui/src/hint.rs index e59eab5a7..8e16e749e 100644 --- a/tui/src/hint.rs +++ b/tui/src/hint.rs @@ -1,20 +1,10 @@ +use std::borrow::Cow; + use ratatui::{ - layout::{Margin, Rect}, style::{Style, Stylize}, text::{Line, Span}, - widgets::{Block, Borders, Paragraph}, - Frame, }; -use crate::state::{AppState, Focus}; - -pub const SHORTCUT_LINES: usize = 2; - -pub struct ShortcutList { - pub scope_name: &'static str, - pub hints: Vec, -} - pub struct Shortcut { pub key_sequences: Vec>, pub desc: &'static str, @@ -32,54 +22,63 @@ fn add_spacing(list: Vec>) -> Line { pub fn span_vec_len(span_vec: &[Span]) -> usize { span_vec.iter().rfold(0, |init, s| init + s.width()) } -impl ShortcutList { - pub fn draw(&self, frame: &mut Frame, area: Rect) { - let block = Block::default() - .title(format!(" {} ", self.scope_name)) - .borders(Borders::all()); - let inner_area = area.inner(Margin::new(1, 1)); - let shortcut_spans: Vec> = self.hints.iter().map(|h| h.to_spans()).collect(); - let mut lines: Vec = Vec::with_capacity(SHORTCUT_LINES); +pub fn create_shortcut_list( + shortcuts: impl IntoIterator, + render_width: u16, +) -> Box<[Line<'static>]> { + let hints = shortcuts.into_iter().collect::>(); - let shortcut_list = (0..SHORTCUT_LINES - 1).fold(shortcut_spans, |mut acc, _| { - let split_idx = acc - .iter() - .scan(0_usize, |total_len, s| { + let mut shortcut_spans: Vec>> = hints.iter().map(|h| h.to_spans()).collect(); + + let mut lines: Vec> = vec![]; + + loop { + let split_idx = shortcut_spans + .iter() + .scan(0usize, |total_len, s| { + // take at least one so that we guarantee that we drain the list + // otherwise, this might lock up if there's a shortcut that exceeds the window width + if *total_len == 0 { + *total_len += span_vec_len(s) + 4; + Some(()) + } else { *total_len += span_vec_len(s); - if *total_len > inner_area.width as usize { + if *total_len > render_width as usize { None } else { *total_len += 4; - Some(1) + Some(()) } - }) - .count(); - - let new_shortcut_list = acc.split_off(split_idx); - lines.push(add_spacing(acc)); + } + }) + .count(); - new_shortcut_list - }); - lines.push(add_spacing(shortcut_list)); + let rest = shortcut_spans.split_off(split_idx); + lines.push(add_spacing(shortcut_spans)); - let p = Paragraph::new(lines).block(block); - frame.render_widget(p, area); + if rest.is_empty() { + break; + } else { + shortcut_spans = rest; + } } + + lines.into_boxed_slice() } impl Shortcut { - pub fn new(key_sequences: Vec<&'static str>, desc: &'static str) -> Self { + pub fn new(desc: &'static str, key_sequences: [&'static str; N]) -> Self { Self { key_sequences: key_sequences .iter() - .map(|s| Span::styled(*s, Style::default().bold())) + .map(|s| Span::styled(Cow::<'static, str>::Borrowed(s), Style::default().bold())) .collect(), desc, } } - fn to_spans(&self) -> Vec { + fn to_spans(&self) -> Vec> { let mut ret: Vec<_> = self .key_sequences .iter() @@ -95,77 +94,3 @@ impl Shortcut { ret } } - -fn get_list_item_shortcut(state: &AppState) -> Vec { - if state.selected_item_is_dir() { - vec![Shortcut::new( - vec!["l", "Right", "Enter"], - "Go to selected dir", - )] - } else { - vec![ - Shortcut::new(vec!["l", "Right", "Enter"], "Run selected command"), - Shortcut::new(vec!["p"], "Enable preview"), - Shortcut::new(vec!["d"], "Command Description"), - ] - } -} - -pub fn draw_shortcuts(state: &AppState, frame: &mut Frame, area: Rect) { - match state.focus { - Focus::Search => ShortcutList { - scope_name: "Search bar", - hints: vec![Shortcut::new(vec!["Enter"], "Finish search")], - }, - - Focus::List => { - let mut hints = Vec::new(); - hints.push(Shortcut::new(vec!["q", "CTRL-c"], "Exit linutil")); - - if state.at_root() { - hints.push(Shortcut::new(vec!["h", "Left"], "Focus tab list")); - hints.extend(get_list_item_shortcut(state)); - } else if state.selected_item_is_up_dir() { - hints.push(Shortcut::new( - vec!["l", "Right", "Enter", "h", "Left"], - "Go to parent directory", - )); - } else { - hints.push(Shortcut::new(vec!["h", "Left"], "Go to parent directory")); - hints.extend(get_list_item_shortcut(state)); - } - hints.push(Shortcut::new(vec!["k", "Up"], "Select item above")); - hints.push(Shortcut::new(vec!["j", "Down"], "Select item below")); - hints.push(Shortcut::new(vec!["t"], "Next theme")); - hints.push(Shortcut::new(vec!["T"], "Previous theme")); - if state.is_current_tab_multi_selectable() { - hints.push(Shortcut::new(vec!["v"], "Toggle multi-selection mode")); - hints.push(Shortcut::new(vec!["Space"], "Select multiple commands")); - } - hints.push(Shortcut::new(vec!["Tab"], "Next tab")); - hints.push(Shortcut::new(vec!["Shift-Tab"], "Previous tab")); - hints.push(Shortcut::new(vec!["g"], "Important actions guide")); - ShortcutList { - scope_name: "Command list", - hints, - } - } - - Focus::TabList => ShortcutList { - scope_name: "Tab list", - hints: vec![ - Shortcut::new(vec!["q", "CTRL-c"], "Exit linutil"), - Shortcut::new(vec!["l", "Right", "Enter"], "Focus action list"), - Shortcut::new(vec!["k", "Up"], "Select item above"), - Shortcut::new(vec!["j", "Down"], "Select item below"), - Shortcut::new(vec!["t"], "Next theme"), - Shortcut::new(vec!["T"], "Previous theme"), - Shortcut::new(vec!["Tab"], "Next tab"), - Shortcut::new(vec!["Shift-Tab"], "Previous tab"), - ], - }, - - Focus::FloatingWindow(ref float) => float.get_shortcut_list(), - } - .draw(frame, area); -} diff --git a/tui/src/running_command.rs b/tui/src/running_command.rs index e1d4b0a01..366a3dc36 100644 --- a/tui/src/running_command.rs +++ b/tui/src/running_command.rs @@ -1,7 +1,4 @@ -use crate::{ - float::FloatContent, - hint::{Shortcut, ShortcutList}, -}; +use crate::{float::FloatContent, hint::Shortcut}; use crossterm::event::{KeyCode, KeyEvent, KeyModifiers}; use linutil_core::Command; use oneshot::{channel, Receiver}; @@ -120,17 +117,17 @@ impl FloatContent for RunningCommand { } } - fn get_shortcut_list(&self) -> ShortcutList { + fn get_shortcut_list(&self) -> (&str, Box<[Shortcut]>) { if self.is_finished() { - ShortcutList { - scope_name: "Finished command", - hints: vec![Shortcut::new(vec!["Enter", "q"], "Close window")], - } + ( + "Finished command", + Box::new([Shortcut::new("Close window", ["Enter", "q"])]), + ) } else { - ShortcutList { - scope_name: "Running command", - hints: vec![Shortcut::new(vec!["CTRL-c"], "Kill the command")], - } + ( + "Running command", + Box::new([Shortcut::new("Kill the command", ["CTRL-c"])]), + ) } } } diff --git a/tui/src/state.rs b/tui/src/state.rs index 4aee0aaa8..3448a3af4 100644 --- a/tui/src/state.rs +++ b/tui/src/state.rs @@ -2,7 +2,7 @@ use crate::{ filter::{Filter, SearchAction}, float::{Float, FloatContent}, floating_text::{FloatingText, FloatingTextMode}, - hint::{draw_shortcuts, SHORTCUT_LINES}, + hint::{create_shortcut_list, Shortcut}, running_command::RunningCommand, theme::Theme, }; @@ -12,9 +12,9 @@ use linutil_core::{Command, ListNode, Tab}; #[cfg(feature = "tips")] use rand::Rng; use ratatui::{ - layout::{Alignment, Constraint, Direction, Layout}, + layout::{Alignment, Constraint, Direction, Flex, Layout}, style::{Style, Stylize}, - text::{Line, Span}, + text::{Line, Span, Text}, widgets::{Block, Borders, List, ListState, Paragraph}, Frame, }; @@ -76,6 +76,7 @@ impl AppState { pub fn new(theme: Theme, override_validation: bool) -> Self { let tabs = linutil_core::get_tabs(!override_validation); let root_id = tabs[0].tree.root().id(); + let mut state = Self { theme, focus: Focus::List, @@ -90,9 +91,82 @@ impl AppState { #[cfg(feature = "tips")] tip: get_random_tip(), }; + state.update_items(); state } + + fn get_list_item_shortcut(&self) -> Box<[Shortcut]> { + if self.selected_item_is_dir() { + Box::new([Shortcut::new("Go to selected dir", ["l", "Right", "Enter"])]) + } else { + Box::new([ + Shortcut::new("Run selected command", ["l", "Right", "Enter"]), + Shortcut::new("Enable preview", ["p"]), + Shortcut::new("Command Description", ["d"]), + ]) + } + } + + pub fn get_keybinds(&self) -> (&str, Box<[Shortcut]>) { + match self.focus { + Focus::Search => ( + "Search bar", + Box::new([Shortcut::new("Finish search", ["Enter"])]), + ), + + Focus::List => { + let mut hints = Vec::new(); + hints.push(Shortcut::new("Exit linutil", ["q", "CTRL-c"])); + + if self.at_root() { + hints.push(Shortcut::new("Focus tab list", ["h", "Left"])); + hints.extend(self.get_list_item_shortcut()); + } else if self.selected_item_is_up_dir() { + hints.push(Shortcut::new( + "Go to parent directory", + ["l", "Right", "Enter", "h", "Left"], + )); + } else { + hints.push(Shortcut::new("Go to parent directory", ["h", "Left"])); + hints.extend(self.get_list_item_shortcut()); + } + + hints.push(Shortcut::new("Select item above", ["k", "Up"])); + hints.push(Shortcut::new("Select item below", ["j", "Down"])); + hints.push(Shortcut::new("Next theme", ["t"])); + hints.push(Shortcut::new("Previous theme", ["T"])); + + if self.is_current_tab_multi_selectable() { + hints.push(Shortcut::new("Toggle multi-selection mode", ["v"])); + hints.push(Shortcut::new("Select multiple commands", ["Space"])); + } + + hints.push(Shortcut::new("Next tab", ["Tab"])); + hints.push(Shortcut::new("Previous tab", ["Shift-Tab"])); + hints.push(Shortcut::new("Important actions guide", ["g"])); + + ("Command list", hints.into_boxed_slice()) + } + + Focus::TabList => ( + "Tab list", + Box::new([ + Shortcut::new("Exit linutil", ["q", "CTRL-c"]), + Shortcut::new("Focus action list", ["l", "Right", "Enter"]), + Shortcut::new("Select item above", ["k", "Up"]), + Shortcut::new("Select item below", ["j", "Down"]), + Shortcut::new("Next theme", ["t"]), + Shortcut::new("Previous theme", ["T"]), + Shortcut::new("Next tab", ["Tab"]), + Shortcut::new("Previous tab", ["Shift-Tab"]), + ]), + ), + + Focus::FloatingWindow(ref float) => float.get_shortcut_list(), + } + } + pub fn draw(&mut self, frame: &mut Frame) { let terminal_size = frame.area(); @@ -153,12 +227,26 @@ impl AppState { .unwrap_or(0) .max(str1.len() + str2.len()); + let (keybind_scope, shortcuts) = self.get_keybinds(); + + let keybind_render_width = terminal_size.width - 2; + + let keybinds_block = Block::default() + .title(format!(" {} ", keybind_scope)) + .borders(Borders::all()); + + let keybinds = create_shortcut_list(shortcuts, keybind_render_width); + let n_lines = keybinds.len() as u16; + + let keybind_para = Paragraph::new(Text::from_iter(keybinds)).block(keybinds_block); + let vertical = Layout::default() .direction(Direction::Vertical) .constraints([ - Constraint::Percentage(100), - Constraint::Min(2 + SHORTCUT_LINES as u16), + Constraint::Percentage(0), + Constraint::Max(n_lines as u16 + 2), ]) + .flex(Flex::Legacy) .margin(0) .split(frame.area()); @@ -305,7 +393,7 @@ impl AppState { float.draw(frame, chunks[1]); } - draw_shortcuts(self, frame, vertical[1]); + frame.render_widget(keybind_para, vertical[1]); } pub fn handle_key(&mut self, key: &KeyEvent) -> bool { @@ -355,11 +443,13 @@ impl AppState { self.focus = Focus::List; } } + Focus::Search => match self.filter.handle_key(key) { SearchAction::Exit => self.exit_search(), SearchAction::Update => self.update_items(), SearchAction::None => {} }, + Focus::TabList => match key.code { KeyCode::Enter | KeyCode::Char('l') | KeyCode::Right => self.focus = Focus::List, @@ -381,19 +471,14 @@ impl AppState { KeyCode::Char('g') => self.toggle_task_list_guide(), _ => {} }, + Focus::List if key.kind != KeyEventKind::Release => match key.code { KeyCode::Char('j') | KeyCode::Down => self.selection.select_next(), KeyCode::Char('k') | KeyCode::Up => self.selection.select_previous(), KeyCode::Char('p') | KeyCode::Char('P') => self.enable_preview(), KeyCode::Char('d') | KeyCode::Char('D') => self.enable_description(), KeyCode::Enter | KeyCode::Char('l') | KeyCode::Right => self.handle_enter(), - KeyCode::Char('h') | KeyCode::Left => { - if self.at_root() { - self.focus = Focus::TabList; - } else { - self.enter_parent_directory(); - } - } + KeyCode::Char('h') | KeyCode::Left => self.go_back(), KeyCode::Char('/') => self.enter_search(), KeyCode::Char('t') => self.theme.next(), KeyCode::Char('T') => self.theme.prev(), @@ -402,10 +487,12 @@ impl AppState { KeyCode::Char(' ') if self.multi_select => self.toggle_selection(), _ => {} }, + _ => (), }; true } + fn toggle_multi_select(&mut self) { if self.is_current_tab_multi_selectable() { self.multi_select = !self.multi_select; @@ -414,6 +501,7 @@ impl AppState { } } } + fn toggle_selection(&mut self) { if let Some(command) = self.get_selected_command() { if self.selected_commands.contains(&command) { @@ -423,12 +511,14 @@ impl AppState { } } } + pub fn is_current_tab_multi_selectable(&self) -> bool { let index = self.current_tab.selected().unwrap_or(0); self.tabs .get(index) .map_or(false, |tab| tab.multi_selectable) } + fn update_items(&mut self) { self.filter.update_items( &self.tabs, @@ -448,11 +538,20 @@ impl AppState { self.visit_stack.len() == 1 } + fn go_back(&mut self) { + if self.at_root() { + self.focus = Focus::TabList; + } else { + self.enter_parent_directory(); + } + } + fn enter_parent_directory(&mut self) { self.visit_stack.pop(); self.selection.select(Some(0)); self.update_items(); } + fn get_selected_node(&self) -> Option<&ListNode> { let mut selected_index = self.selection.selected().unwrap_or(0); From 42e45964a9ad70a29792a64bacc7d63243cd96b5 Mon Sep 17 00:00:00 2001 From: Guru Swarupa <112751363+guruswarupa@users.noreply.github.com> Date: Sat, 28 Sep 2024 19:11:29 +0000 Subject: [PATCH 12/15] Update power-profile.sh (#655) --- core/tabs/utils/power-profile.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/tabs/utils/power-profile.sh b/core/tabs/utils/power-profile.sh index 996db704a..536f7c692 100644 --- a/core/tabs/utils/power-profile.sh +++ b/core/tabs/utils/power-profile.sh @@ -34,6 +34,7 @@ installAutoCpufreq() { cd auto-cpufreq printf "%b\n" "${YELLOW}Running auto-cpufreq installer...${RC}" "$ESCALATION_TOOL" ./auto-cpufreq-installer + "$ESCALATION_TOOL" auto-cpufreq --install cd .. fi @@ -94,4 +95,4 @@ apply_or_remove_auto_cpufreq() { checkEnv checkEscalationTool installAutoCpufreq -apply_or_remove_auto_cpufreq \ No newline at end of file +apply_or_remove_auto_cpufreq From fc67777cd7b271b09204a2c3765afd750d20af8f Mon Sep 17 00:00:00 2001 From: Nyx <144965845+nnyyxxxx@users.noreply.github.com> Date: Sat, 28 Sep 2024 15:13:03 -0400 Subject: [PATCH 13/15] Separate browser scripts (#648) * Separate browser scripts * sort entries alphabetically * fix formatting issues * add --needed --------- Co-authored-by: nnyyxxxx --- core/tabs/applications-setup/browser-setup.sh | 246 ------------------ .../tabs/applications-setup/browsers/brave.sh | 45 ++++ .../applications-setup/browsers/chromium.sh | 23 ++ .../applications-setup/browsers/firefox.sh | 33 +++ .../browsers/google-chrome.sh | 39 +++ .../applications-setup/browsers/librewolf.sh | 48 ++++ core/tabs/applications-setup/browsers/lynx.sh | 23 ++ .../applications-setup/browsers/thorium.sh | 35 +++ .../applications-setup/browsers/vivaldi.sh | 23 ++ core/tabs/applications-setup/tab_data.toml | 57 +++- 10 files changed, 320 insertions(+), 252 deletions(-) delete mode 100755 core/tabs/applications-setup/browser-setup.sh create mode 100644 core/tabs/applications-setup/browsers/brave.sh create mode 100644 core/tabs/applications-setup/browsers/chromium.sh create mode 100644 core/tabs/applications-setup/browsers/firefox.sh create mode 100644 core/tabs/applications-setup/browsers/google-chrome.sh create mode 100644 core/tabs/applications-setup/browsers/librewolf.sh create mode 100644 core/tabs/applications-setup/browsers/lynx.sh create mode 100644 core/tabs/applications-setup/browsers/thorium.sh create mode 100644 core/tabs/applications-setup/browsers/vivaldi.sh diff --git a/core/tabs/applications-setup/browser-setup.sh b/core/tabs/applications-setup/browser-setup.sh deleted file mode 100755 index dcd58c0a2..000000000 --- a/core/tabs/applications-setup/browser-setup.sh +++ /dev/null @@ -1,246 +0,0 @@ -#!/bin/sh -e - -. ../common-script.sh - -install_chrome() { - if ! command_exists google-chrome; then - printf "%b\n" "${YELLOW}Installing Google Chrome..${RC}." - case "$PACKAGER" in - apt-get|nala) - curl -O https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb - "$ESCALATION_TOOL" "$PACKAGER" install -y ./google-chrome-stable_current_amd64.deb - ;; - zypper) - "$ESCALATION_TOOL" "$PACKAGER" addrepo http://dl.google.com/linux/chrome/rpm/stable/x86_64 Google-Chrome - "$ESCALATION_TOOL" "$PACKAGER" refresh - "$ESCALATION_TOOL" "$PACKAGER" --non-interactive install google-chrome-stable - ;; - pacman) - "$AUR_HELPER" -S --noconfirm google-chrome - ;; - dnf) - "$ESCALATION_TOOL" "$PACKAGER" install -y fedora-workstation-repositories - "$ESCALATION_TOOL" "$PACKAGER" config-manager --set-enabled google-chrome - "$ESCALATION_TOOL" "$PACKAGER" install -y google-chrome-stable - ;; - *) - printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" - ;; - esac - else - printf "%b\n" "${GREEN}Google Chrome Browser is already installed.${RC}" - fi -} - -install_thorium() { - if ! command_exists thorium-browser; then - printf "%b\n" "${YELLOW}Installing Thorium Browser...${RC}" - case "$PACKAGER" in - apt-get|nala) - "$ESCALATION_TOOL" rm -fv /etc/apt/sources.list.d/thorium.list - "$ESCALATION_TOOL" curl http://dl.thorium.rocks/debian/dists/stable/thorium.list -o /etc/apt/sources.list.d/thorium.list - "$ESCALATION_TOOL" "$PACKAGER" update - "$ESCALATION_TOOL" "$PACKAGER" install -y thorium-browser - ;; - zypper|dnf) - url=$(curl -s https://api.github.com/repos/Alex313031/Thorium/releases/latest | grep -oP '(?<=browser_download_url": ")[^"]*\.rpm') - echo "$url" && curl -L "$url" -o thorium-latest.rpm - "$ESCALATION_TOOL" "$PACKAGER" install -y thorium-latest.rpm && rm thorium-latest.rpm - ;; - pacman) - "$AUR_HELPER" -S --needed --noconfirm thorium-browser-bin - ;; - *) - printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" - ;; - esac - else - printf "%b\n" "${GREEN}Thorium Browser is already installed.${RC}" - fi -} - -install_firefox() { - if ! command_exists firefox; then - printf "%b\n" "${YELLOW}Installing Mozilla Firefox...${RC}" - case "$PACKAGER" in - apt-get|nala) - "$ESCALATION_TOOL" "$PACKAGER" install -y firefox-esr - ;; - zypper) - "$ESCALATION_TOOL" "$PACKAGER" --non-interactive install MozillaFirefox - ;; - pacman) - "$ESCALATION_TOOL" "$PACKAGER" -S --noconfirm firefox - ;; - dnf) - "$ESCALATION_TOOL" "$PACKAGER" install -y firefox - ;; - *) - printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" - exit 1 - ;; - esac - else - printf "%b\n" "${GREEN}Firefox Browser is already installed.${RC}" - fi -} - -install_librewolf() { - if ! command_exists librewolf; then - printf "%b\n" "${YELLOW}Installing Librewolf...${RC}" - case "$PACKAGER" in - apt-get|nala) - "$ESCALATION_TOOL" "$PACKAGER" install -y gnupg lsb-release apt-transport-https ca-certificates - distro=`if echo " una bookworm vanessa focal jammy bullseye vera uma " | grep -q " $(lsb_release -sc) "; then lsb_release -sc; else echo focal; fi` - curl -fsSL https://deb.librewolf.net/keyring.gpg | "$ESCALATION_TOOL" gpg --dearmor -o /usr/share/keyrings/librewolf.gpg - echo "Types: deb -URIs: https://deb.librewolf.net -Suites: $distro -Components: main -Architectures: amd64 -Signed-By: /usr/share/keyrings/librewolf.gpg" | "$ESCALATION_TOOL" tee /etc/apt/sources.list.d/librewolf.sources > /dev/null - "$ESCALATION_TOOL" "$PACKAGER" update - "$ESCALATION_TOOL" "$PACKAGER" install -y librewolf - ;; - dnf) - curl -fsSL https://rpm.librewolf.net/librewolf-repo.repo | pkexec tee /etc/yum.repos.d/librewolf.repo > /dev/null - "$ESCALATION_TOOL" "$PACKAGER" install -y librewolf - ;; - zypper) - "$ESCALATION_TOOL" rpm --import https://rpm.librewolf.net/pubkey.gpg - "$ESCALATION_TOOL" zypper ar -ef https://rpm.librewolf.net librewolf - "$ESCALATION_TOOL" zypper refresh - "$ESCALATION_TOOL" zypper --non-interactive install librewolf - ;; - pacman) - "$AUR_HELPER" -S --needed --noconfirm librewolf-bin - ;; - *) - printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" - exit 1 - ;; - esac - else - printf "%b\n" "${GREEN}LibreWolf Browser is already installed.${RC}" - fi -} - -install_brave() { - if ! command_exists brave; then - printf "%b\n" "${YELLOW}Installing Brave...${RC}" - case "$PACKAGER" in - apt-get|nala) - "$ESCALATION_TOOL" "$PACKAGER" install -y curl - "$ESCALATION_TOOL" curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg https://brave-browser-apt-release.s3.brave.com/brave-browser-archive-keyring.gpg - echo "deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg] https://brave-browser-apt-release.s3.brave.com/ stable main"| "$ESCALATION_TOOL" tee /etc/apt/sources.list.d/brave-browser-release.list - "$ESCALATION_TOOL" "$PACKAGER" update - "$ESCALATION_TOOL" "$PACKAGER" install -y brave-browser - ;; - zypper) - "$ESCALATION_TOOL" "$PACKAGER" install -y curl - "$ESCALATION_TOOL" rpm --import https://brave-browser-rpm-release.s3.brave.com/brave-core.asc - "$ESCALATION_TOOL" "$PACKAGER" addrepo https://brave-browser-rpm-release.s3.brave.com/brave-browser.repo - "$ESCALATION_TOOL" "$PACKAGER" refresh - "$ESCALATION_TOOL" "$PACKAGER" --non-interactive install brave-browser - ;; - pacman) - "$AUR_HELPER" -S --noconfirm brave-bin - ;; - dnf) - "$ESCALATION_TOOL" "$PACKAGER" install -y dnf-plugins-core - "$ESCALATION_TOOL" "$PACKAGER" config-manager --add-repo https://brave-browser-rpm-release.s3.brave.com/brave-browser.repo - "$ESCALATION_TOOL" rpm --import https://brave-browser-rpm-release.s3.brave.com/brave-core.asc - "$ESCALATION_TOOL" "$PACKAGER" install -y brave-browser - ;; - *) - printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" - exit 1 - ;; - esac - else - printf "%b\n" "${GREEN}Brave Browser is already installed.${RC}" - fi -} - -install_vivaldi() { - if ! command_exists vivaldi; then - printf "%b\n" "${YELLOW}Installing Vivaldi...${RC}" - curl -fsSL https://downloads.vivaldi.com/snapshot/install-vivaldi.sh | sh - if [ $? -eq 0 ]; then - printf "%b\n" "${GREEN}Vivaldi installed successfully!${RC}" - else - printf "%b\n" "${RED}Vivaldi installation failed!${RC}" - fi - else - printf "%b\n" "${GREEN}Vivaldi Browser is already installed.${RC}" - fi -} - -install_chromium() { - if ! command_exists chromium; then - printf "%b\n" "${YELLOW}Installing Chromium...${RC}" - case "$PACKAGER" in - pacman) - "$ESCALATION_TOOL" "$PACKAGER" -S --noconfirm chromium - ;; - *) - "$ESCALATION_TOOL" "$PACKAGER" install -y chromium - ;; - esac - else - printf "%b\n" "${GREEN}Chromium Browser is already installed.${RC}" - fi -} - -install_lynx() { - if ! command_exists lynx; then - printf "%b\n" "${YELLOW}Installing Lynx...${RC}" - case "$PACKAGER" in - pacman) - "$ESCALATION_TOOL" "$PACKAGER" -S --noconfirm lynx - ;; - *) - "$ESCALATION_TOOL" "$PACKAGER" install -y lynx - ;; - esac - else - printf "%b\n" "${GREEN}Lynx TUI Browser is already installed.${RC}" - fi -} - -browserSetup() { - clear - printf "%b\n" "Browser Installation Script" - printf "%b\n" "----------------------------" - printf "%b\n" "Select the browsers you want to install:" - printf "%b\n" "1. Google Chrome" - printf "%b\n" "2. Mozilla Firefox" - printf "%b\n" "3. Librewolf" - printf "%b\n" "4. Brave" - printf "%b\n" "5. Vivaldi" - printf "%b\n" "6. Chromium" - printf "%b\n" "7. Thorium" - printf "%b\n" "8. Lynx" - printf "%b\n" "----------------------------" - printf "%b" "Enter your choices (e.g. 1 3 5): " - read -r choice - for ch in $choice; do - case $ch in - 1) install_chrome ;; - 2) install_firefox ;; - 3) install_librewolf ;; - 4) install_brave ;; - 5) install_vivaldi ;; - 6) install_chromium ;; - 7) install_thorium ;; - 8) install_lynx;; - *) printf "%b\n" "${RED}Invalid option: $ch ${RC}" ;; - esac - done - printf "%b\n" "${GREEN}Installation complete!${RC}" -} - -checkEnv -checkEscalationTool -checkAURHelper -browserSetup diff --git a/core/tabs/applications-setup/browsers/brave.sh b/core/tabs/applications-setup/browsers/brave.sh new file mode 100644 index 000000000..8a7eab403 --- /dev/null +++ b/core/tabs/applications-setup/browsers/brave.sh @@ -0,0 +1,45 @@ +#!/bin/sh -e + +. ../../common-script.sh + +installBrave() { + if ! command_exists brave; then + printf "%b\n" "${YELLOW}Installing Brave...${RC}" + case "$PACKAGER" in + apt-get|nala) + "$ESCALATION_TOOL" "$PACKAGER" install -y curl + "$ESCALATION_TOOL" curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg https://brave-browser-apt-release.s3.brave.com/brave-browser-archive-keyring.gpg + echo "deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg] https://brave-browser-apt-release.s3.brave.com/ stable main" | "$ESCALATION_TOOL" tee /etc/apt/sources.list.d/brave-browser-release.list + "$ESCALATION_TOOL" "$PACKAGER" update + "$ESCALATION_TOOL" "$PACKAGER" install -y brave-browser + ;; + zypper) + "$ESCALATION_TOOL" "$PACKAGER" install -y curl + "$ESCALATION_TOOL" rpm --import https://brave-browser-rpm-release.s3.brave.com/brave-core.asc + "$ESCALATION_TOOL" "$PACKAGER" addrepo https://brave-browser-rpm-release.s3.brave.com/brave-browser.repo + "$ESCALATION_TOOL" "$PACKAGER" refresh + "$ESCALATION_TOOL" "$PACKAGER" --non-interactive install brave-browser + ;; + pacman) + "$AUR_HELPER" -S --needed --noconfirm brave-bin + ;; + dnf) + "$ESCALATION_TOOL" "$PACKAGER" install -y dnf-plugins-core + "$ESCALATION_TOOL" "$PACKAGER" config-manager --add-repo https://brave-browser-rpm-release.s3.brave.com/brave-browser.repo + "$ESCALATION_TOOL" rpm --import https://brave-browser-rpm-release.s3.brave.com/brave-core.asc + "$ESCALATION_TOOL" "$PACKAGER" install -y brave-browser + ;; + *) + printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" + exit 1 + ;; + esac + else + printf "%b\n" "${GREEN}Brave Browser is already installed.${RC}" + fi +} + +checkEnv +checkEscalationTool +checkAURHelper +installBrave \ No newline at end of file diff --git a/core/tabs/applications-setup/browsers/chromium.sh b/core/tabs/applications-setup/browsers/chromium.sh new file mode 100644 index 000000000..e929dbc9d --- /dev/null +++ b/core/tabs/applications-setup/browsers/chromium.sh @@ -0,0 +1,23 @@ +#!/bin/sh -e + +. ../../common-script.sh + +installChromium() { +if ! command_exists chromium; then + printf "%b\n" "${YELLOW}Installing Chromium...${RC}" + case "$PACKAGER" in + pacman) + "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm chromium + ;; + *) + "$ESCALATION_TOOL" "$PACKAGER" install -y chromium + ;; + esac +else + printf "%b\n" "${GREEN}Chromium Browser is already installed.${RC}" +fi +} + +checkEnv +checkEscalationTool +installChromium \ No newline at end of file diff --git a/core/tabs/applications-setup/browsers/firefox.sh b/core/tabs/applications-setup/browsers/firefox.sh new file mode 100644 index 000000000..67980858b --- /dev/null +++ b/core/tabs/applications-setup/browsers/firefox.sh @@ -0,0 +1,33 @@ +#!/bin/sh -e + +. ../../common-script.sh + +installFirefox() { + if ! command_exists firefox; then + printf "%b\n" "${YELLOW}Installing Mozilla Firefox...${RC}" + case "$PACKAGER" in + apt-get|nala) + "$ESCALATION_TOOL" "$PACKAGER" install -y firefox-esr + ;; + zypper) + "$ESCALATION_TOOL" "$PACKAGER" --non-interactive install MozillaFirefox + ;; + pacman) + "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm firefox + ;; + dnf) + "$ESCALATION_TOOL" "$PACKAGER" install -y firefox + ;; + *) + printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" + exit 1 + ;; + esac + else + printf "%b\n" "${GREEN}Firefox Browser is already installed.${RC}" + fi +} + +checkEnv +checkEscalationTool +installFirefox diff --git a/core/tabs/applications-setup/browsers/google-chrome.sh b/core/tabs/applications-setup/browsers/google-chrome.sh new file mode 100644 index 000000000..d66ec9a57 --- /dev/null +++ b/core/tabs/applications-setup/browsers/google-chrome.sh @@ -0,0 +1,39 @@ +#!/bin/sh -e + +. ../../common-script.sh + +installChrome() { + if ! command_exists google-chrome; then + printf "%b\n" "${YELLOW}Installing Google Chrome...${RC}" + case "$PACKAGER" in + apt-get|nala) + curl -O https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb + "$ESCALATION_TOOL" "$PACKAGER" install -y ./google-chrome-stable_current_amd64.deb + ;; + zypper) + "$ESCALATION_TOOL" "$PACKAGER" addrepo http://dl.google.com/linux/chrome/rpm/stable/x86_64 Google-Chrome + "$ESCALATION_TOOL" "$PACKAGER" refresh + "$ESCALATION_TOOL" "$PACKAGER" --non-interactive install google-chrome-stable + ;; + pacman) + "$AUR_HELPER" -S --needed --noconfirm google-chrome + ;; + dnf) + "$ESCALATION_TOOL" "$PACKAGER" install -y fedora-workstation-repositories + "$ESCALATION_TOOL" "$PACKAGER" config-manager --set-enabled google-chrome + "$ESCALATION_TOOL" "$PACKAGER" install -y google-chrome-stable + ;; + *) + printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" + exit 1 + ;; + esac + else + printf "%b\n" "${GREEN}Google Chrome Browser is already installed.${RC}" + fi +} + +checkEnv +checkEscalationTool +checkAURHelper +installChrome \ No newline at end of file diff --git a/core/tabs/applications-setup/browsers/librewolf.sh b/core/tabs/applications-setup/browsers/librewolf.sh new file mode 100644 index 000000000..a630b9c7c --- /dev/null +++ b/core/tabs/applications-setup/browsers/librewolf.sh @@ -0,0 +1,48 @@ +#!/bin/sh -e + +. ../../common-script.sh + +installLibreWolf() { + if ! command_exists librewolf; then + printf "%b\n" "${YELLOW}Installing Librewolf...${RC}" + case "$PACKAGER" in + apt-get|nala) + "$ESCALATION_TOOL" "$PACKAGER" install -y gnupg lsb-release apt-transport-https ca-certificates + distro=`if echo " una bookworm vanessa focal jammy bullseye vera uma " | grep -q " $(lsb_release -sc) "; then lsb_release -sc; else echo focal; fi` + curl -fsSL https://deb.librewolf.net/keyring.gpg | "$ESCALATION_TOOL" gpg --dearmor -o /usr/share/keyrings/librewolf.gpg + echo "Types: deb +URIs: https://deb.librewolf.net +Suites: $distro +Components: main +Architectures: amd64 +Signed-By: /usr/share/keyrings/librewolf.gpg" | "$ESCALATION_TOOL" tee /etc/apt/sources.list.d/librewolf.sources > /dev/null + "$ESCALATION_TOOL" "$PACKAGER" update + "$ESCALATION_TOOL" "$PACKAGER" install -y librewolf + ;; + dnf) + curl -fsSL https://rpm.librewolf.net/librewolf-repo.repo | pkexec tee /etc/yum.repos.d/librewolf.repo > /dev/null + "$ESCALATION_TOOL" "$PACKAGER" install -y librewolf + ;; + zypper) + "$ESCALATION_TOOL" rpm --import https://rpm.librewolf.net/pubkey.gpg + "$ESCALATION_TOOL" zypper ar -ef https://rpm.librewolf.net librewolf + "$ESCALATION_TOOL" zypper refresh + "$ESCALATION_TOOL" zypper --non-interactive install librewolf + ;; + pacman) + "$AUR_HELPER" -S --needed --noconfirm librewolf-bin + ;; + *) + printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" + exit 1 + ;; + esac + else + printf "%b\n" "${GREEN}LibreWolf Browser is already installed.${RC}" + fi +} + +checkEnv +checkEscalationTool +checkAURHelper +installLibreWolf \ No newline at end of file diff --git a/core/tabs/applications-setup/browsers/lynx.sh b/core/tabs/applications-setup/browsers/lynx.sh new file mode 100644 index 000000000..002ff7e3e --- /dev/null +++ b/core/tabs/applications-setup/browsers/lynx.sh @@ -0,0 +1,23 @@ +#!/bin/sh -e + +. ../../common-script.sh + +installLynx() { + if ! command_exists lynx; then + printf "%b\n" "${YELLOW}Installing Lynx...${RC}" + case "$PACKAGER" in + pacman) + "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm lynx + ;; + *) + "$ESCALATION_TOOL" "$PACKAGER" install -y lynx + ;; + esac + else + printf "%b\n" "${GREEN}Lynx TUI Browser is already installed.${RC}" + fi +} + +checkEnv +checkEscalationTool +installLynx \ No newline at end of file diff --git a/core/tabs/applications-setup/browsers/thorium.sh b/core/tabs/applications-setup/browsers/thorium.sh new file mode 100644 index 000000000..c45ebc806 --- /dev/null +++ b/core/tabs/applications-setup/browsers/thorium.sh @@ -0,0 +1,35 @@ +#!/bin/sh -e + +. ../../common-script.sh + +installThrorium() { + if ! command_exists thorium-browser; then + printf "%b\n" "${YELLOW}Installing Thorium Browser...${RC}" + case "$PACKAGER" in + apt-get|nala) + "$ESCALATION_TOOL" rm -fv /etc/apt/sources.list.d/thorium.list + "$ESCALATION_TOOL" curl http://dl.thorium.rocks/debian/dists/stable/thorium.list -o /etc/apt/sources.list.d/thorium.list + "$ESCALATION_TOOL" "$PACKAGER" update + "$ESCALATION_TOOL" "$PACKAGER" install -y thorium-browser + ;; + zypper|dnf) + url=$(curl -s https://api.github.com/repos/Alex313031/Thorium/releases/latest | grep -oP '(?<=browser_download_url": ")[^"]*\.rpm') + echo "$url" && curl -L "$url" -o thorium-latest.rpm + "$ESCALATION_TOOL" "$PACKAGER" install -y thorium-latest.rpm && rm thorium-latest.rpm + ;; + pacman) + "$AUR_HELPER" -S --needed --noconfirm thorium-browser-bin + ;; + *) + printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" + ;; + esac + else + printf "%b\n" "${GREEN}Thorium Browser is already installed.${RC}" + fi +} + +checkEnv +checkEscalationTool +checkAURHelper +installThrorium \ No newline at end of file diff --git a/core/tabs/applications-setup/browsers/vivaldi.sh b/core/tabs/applications-setup/browsers/vivaldi.sh new file mode 100644 index 000000000..002ff7e3e --- /dev/null +++ b/core/tabs/applications-setup/browsers/vivaldi.sh @@ -0,0 +1,23 @@ +#!/bin/sh -e + +. ../../common-script.sh + +installLynx() { + if ! command_exists lynx; then + printf "%b\n" "${YELLOW}Installing Lynx...${RC}" + case "$PACKAGER" in + pacman) + "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm lynx + ;; + *) + "$ESCALATION_TOOL" "$PACKAGER" install -y lynx + ;; + esac + else + printf "%b\n" "${GREEN}Lynx TUI Browser is already installed.${RC}" + fi +} + +checkEnv +checkEscalationTool +installLynx \ No newline at end of file diff --git a/core/tabs/applications-setup/tab_data.toml b/core/tabs/applications-setup/tab_data.toml index 9af2ee4f2..141772bfe 100644 --- a/core/tabs/applications-setup/tab_data.toml +++ b/core/tabs/applications-setup/tab_data.toml @@ -90,6 +90,57 @@ description = "Thunderbird is a free, open-source email client that offers power script = "communication-apps/thunderbird-setup.sh" task_list = "I" +[[data]] +name = "Web Browsers" + +[[data.entries]] +name = "Brave" +description = "Brave is a free and open-source web browser developed by Brave Software, Inc. based on the Chromium web browser." +script = "browsers/brave.sh" +task_list = "I" + +[[data.entries]] +name = "Chromium" +description = "Chromium is an open-source web browser project started by Google, to provide the source code for the proprietary Google Chrome browser." +script = "browsers/chromium.sh" +task_list = "I" + +[[data.entries]] +name = "Google Chrome" +description = "Google Chrome is a fast, secure, and free web browser, built for the modern web." +script = "browsers/google-chrome.sh" +task_list = "I" + +[[data.entries]] +name = "LibreWolf" +description = "LibreWolf is a fork of Firefox, focused on privacy, security, and freedom." +script = "browsers/librewolf.sh" +task_list = "I" + +[[data.entries]] +name = "Lynx" +description = "Lynx is a highly configurable text-based web browser for use on cursor-addressable character cell terminals." +script = "browsers/lynx.sh" +task_list = "I" + +[[data.entries]] +name = "Mozilla Firefox" +description = "Mozilla Firefox is a free and open-source web browser developed by the Mozilla Foundation." +script = "browsers/firefox.sh" +task_list = "I" + +[[data.entries]] +name = "Thorium" +description = "Thorium is a Chromium-based browser focused on privacy and performance." +script = "browsers/thorium.sh" +task_list = "I" + +[[data.entries]] +name = "Vivaldi" +description = "Vivaldi is a freeware, cross-platform web browser developed by Vivaldi Technologies." +script = "browsers/vivaldi.sh" +task_list = "I" + [[data]] name = "Alacritty" description = "Alacritty is a modern terminal emulator that comes with sensible defaults, but allows for extensive configuration. By integrating with other applications, rather than reimplementing their functionality, it manages to provide a flexible set of features with high performance. The supported platforms currently consist of BSD, Linux, macOS and Windows.\nThis command installs and condifures alacritty terminal emulator." @@ -114,12 +165,6 @@ description = "Bottles allows Windows software, like applications and games, to script = "bottles-setup.sh" task_list = "FI" -[[data]] -name = "Web Browsers" -description = "An interactive script to install popular browsers." -script = "browser-setup.sh" -task_list = "I" - [[data]] name = "DWM-Titus" description = "DWM is a dynamic window manager for X.\nIt manages windows in tiled, monocle and floating layouts.\nAll of the layouts can be applied dynamically, optimising the environment for the application in use and the task performed.\nThis command installs and configures DWM and a desktop manager.\nThe list of patches applied can be found in CTT's DWM repository\nhttps://github.com/ChrisTitusTech/dwm-titus" From 35c41e883ced6e0319638b660c6df6829de9a869 Mon Sep 17 00:00:00 2001 From: Nyx <144965845+nnyyxxxx@users.noreply.github.com> Date: Sat, 28 Sep 2024 15:13:35 -0400 Subject: [PATCH 14/15] add git as a dep (#649) Co-authored-by: nnyyxxxx --- core/tabs/common-script.sh | 2 +- core/tabs/system-setup/arch/paru-setup.sh | 2 +- core/tabs/system-setup/arch/yay-setup.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/tabs/common-script.sh b/core/tabs/common-script.sh index b2c991b89..12ab11460 100644 --- a/core/tabs/common-script.sh +++ b/core/tabs/common-script.sh @@ -27,7 +27,7 @@ checkAURHelper() { done printf "%b\n" "${YELLOW}Installing yay as AUR helper...${RC}" - "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm base-devel + "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm base-devel git cd /opt && "$ESCALATION_TOOL" git clone https://aur.archlinux.org/yay-bin.git && "$ESCALATION_TOOL" chown -R "$USER":"$USER" ./yay-bin cd yay-bin && makepkg --noconfirm -si diff --git a/core/tabs/system-setup/arch/paru-setup.sh b/core/tabs/system-setup/arch/paru-setup.sh index 54cc695aa..fba445ef9 100755 --- a/core/tabs/system-setup/arch/paru-setup.sh +++ b/core/tabs/system-setup/arch/paru-setup.sh @@ -7,7 +7,7 @@ installDepend() { pacman) if ! command_exists paru; then printf "%b\n" "${YELLOW}Installing paru as AUR helper...${RC}" - "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm base-devel + "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm base-devel git cd /opt && "$ESCALATION_TOOL" git clone https://aur.archlinux.org/paru.git && "$ESCALATION_TOOL" chown -R "$USER": ./paru cd paru && makepkg --noconfirm -si printf "%b\n" "${GREEN}Paru installed${RC}" diff --git a/core/tabs/system-setup/arch/yay-setup.sh b/core/tabs/system-setup/arch/yay-setup.sh index 77b684295..fd80f1f2f 100755 --- a/core/tabs/system-setup/arch/yay-setup.sh +++ b/core/tabs/system-setup/arch/yay-setup.sh @@ -7,7 +7,7 @@ installDepend() { pacman) if ! command_exists yay; then printf "%b\n" "${YELLOW}Installing yay as AUR helper...${RC}" - "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm base-devel + "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm base-devel git cd /opt && "$ESCALATION_TOOL" git clone https://aur.archlinux.org/yay-bin.git && "$ESCALATION_TOOL" chown -R "$USER": ./yay-bin cd yay-bin && makepkg --noconfirm -si printf "%b\n" "${GREEN}Yay installed${RC}" From a9a678fc116a3d15e35a2c30c723f2a012867394 Mon Sep 17 00:00:00 2001 From: Chris Titus Date: Sat, 28 Sep 2024 15:37:02 -0500 Subject: [PATCH 15/15] update release --- .github/release-drafter.yml | 66 ----------------------------------- .github/release.yml | 20 +++++++++++ .github/workflows/linutil.yml | 22 ++---------- 3 files changed, 22 insertions(+), 86 deletions(-) delete mode 100644 .github/release-drafter.yml create mode 100644 .github/release.yml diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml deleted file mode 100644 index b94fa633b..000000000 --- a/.github/release-drafter.yml +++ /dev/null @@ -1,66 +0,0 @@ -tag-prefix: "" -categories: - - title: '🚀 Features' - labels: - - 'feature' - - 'enhancement' - - title: '🐛 Bug Fixes' - labels: - - 'fix' - - 'bugfix' - - 'bug' - - title: '📚 Documentation' - label: 'documentation' - - title: '🔒 Security' - label: 'security' - - title: '🧰 GitHub Actions' - label: 'github actions' -change-template: '- $TITLE @$AUTHOR (#$NUMBER)' -template: | - ## Changes - - $CHANGES - -change-title-escapes: '\<*_&"''' -autolabeler: - - label: 'documentation' - files: - - '*.md' - branch: - - '/docs{0,1}\/.+/' - - label: 'bug' - branch: - - '/fix\/.+/' - title: - - '/fix/i' - - label: 'enhancement' - branch: - - '/feature\/.+/' - body: - - '/[A-Z]+-[0-9]+/' - - label: 'documentation' - files: - - '**/*.md' - - 'docs/**/*' - - label: 'security' - branch: - - '/security\/.+/' - -include-labels: - - 'documentation' - - 'bug' - - 'enhancement' - - 'security' - - 'github actions' - -replacers: - - search: /"/g - replace: '' - - search: /'/g - replace: '' - - search: /`/g - replace: '' -exclude-labels: - - 'skip-changelog' - -filter-by-commitish: false \ No newline at end of file diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 000000000..51218dc9e --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,20 @@ +changelog: + categories: + - title: '🚀 Features' + labels: + - 'feature' + - 'enhancement' + - title: '🐛 Bug Fixes' + labels: + - 'fix' + - 'bugfix' + - 'bug' + - title: '📚 Documentation' + label: 'documentation' + - title: '🔒 Security' + label: 'security' + - title: '🧰 GitHub Actions' + label: 'github actions' + exclude: + labels: + - 'skip-changelog' \ No newline at end of file diff --git a/.github/workflows/linutil.yml b/.github/workflows/linutil.yml index f7f369e89..f57e8a747 100644 --- a/.github/workflows/linutil.yml +++ b/.github/workflows/linutil.yml @@ -1,8 +1,6 @@ name: LinUtil Release on: - push: - branches: ["main"] workflow_dispatch: permissions: @@ -55,12 +53,6 @@ jobs: mv build/x86_64-unknown-linux-musl/release/linutil build/linutil mv build/aarch64-unknown-linux-musl/release/linutil build/linutil-aarch64 - - name: Pull latest changes - run: | - git config --global user.email "github-actions@github.com" - git config --global user.name "GitHub Actions" - git pull origin main - - uses: stefanzweifel/git-auto-commit-action@v5 with: commit_message: Commit Linutil @@ -75,15 +67,6 @@ jobs: echo "version=$version" >> $GITHUB_ENV shell: bash - - name: Generate Release Notes - id: generate_notes - uses: release-drafter/release-drafter@v6 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - config-name: release-drafter.yml - version: ${{ env.version }} - - name: Create and Upload Release id: create_release uses: softprops/action-gh-release@v2 @@ -91,12 +74,11 @@ jobs: tag_name: ${{ env.version }} name: Pre-Release ${{ env.version }} body: | - ${{ steps.generate_notes.outputs.body }} - ![GitHub Downloads (specific asset, specific tag)](https://img.shields.io/github/downloads/ChrisTitusTech/linutil/${{ env.version }}/linutil) ![GitHub Downloads (specific asset, specific tag)](https://img.shields.io/github/downloads/ChrisTitusTech/linutil/${{ env.version }}/linutil-aarch64) - append_body: false + append_body: true + generate_release_notes: true files: | ./build/linutil ./build/linutil-aarch64