From 65f26795bb4361e1c00c3b1e9422a045bebee1f3 Mon Sep 17 00:00:00 2001 From: Mayur Raut <95993675+RazoBeckett@users.noreply.github.com> Date: Sun, 15 Sep 2024 14:15:27 +0530 Subject: [PATCH 1/5] feat(dwmtitus-setup): add slstatus installation option Compiles and Installs slstatus --- tabs/applications-setup/dwmtitus-setup.sh | 26 +++++++++++++++++++++++ 1 file changed, 26 insertions(+) mode change 100644 => 100755 tabs/applications-setup/dwmtitus-setup.sh diff --git a/tabs/applications-setup/dwmtitus-setup.sh b/tabs/applications-setup/dwmtitus-setup.sh old mode 100644 new mode 100755 index 8c0fc97a..743c8781 --- a/tabs/applications-setup/dwmtitus-setup.sh +++ b/tabs/applications-setup/dwmtitus-setup.sh @@ -295,11 +295,37 @@ setupDisplayManager() { } +install_slstatus() { + printf "Do you want to install slstatus? (y/n): " # using printf instead of 'echo' to avoid newline, -n flag for 'echo' is not supported in POSIX + read -r response # -r flag to prevent backslashes from being interpreted + case "$response" in + [Yy] | [Yy][Ee][Ss]) # Matches: Y, y, Yes, yes, YES, yEs, yeS, etc. + echo "Installing slstatus" + cd slstatus/ || { echo "Failed to change directory to slstatus"; return 1; } + if $ESCALATION_TOOL make clean install; then + echo "slstatus installed successfully" + else + echo "Failed to install slstatus" + return 1 + fi + ;; + [Nn] | [Nn][Oo]) # same logic as above, but for No + echo "Skipping slstatus installation" + ;; + *) + echo "Invalid input. Please enter y/yes or n/no." + install_slstatus + ;; + esac + cd .. +} + checkEnv checkEscalationTool setupDisplayManager setupDWM makeDWM +install_slstatus install_nerd_font clone_config_folders configure_backgrounds From b46569c38ba387f31cb555d653c3aef21d21684b Mon Sep 17 00:00:00 2001 From: Mayur Raut <95993675+RazoBeckett@users.noreply.github.com> Date: Sun, 15 Sep 2024 19:04:39 +0530 Subject: [PATCH 2/5] feat(dwmtitus-setup): improve slstatus installation using loop --- tabs/applications-setup/dwmtitus-setup.sh | 45 ++++++++++++----------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/tabs/applications-setup/dwmtitus-setup.sh b/tabs/applications-setup/dwmtitus-setup.sh index 743c8781..961e8892 100755 --- a/tabs/applications-setup/dwmtitus-setup.sh +++ b/tabs/applications-setup/dwmtitus-setup.sh @@ -296,27 +296,30 @@ setupDisplayManager() { } install_slstatus() { - printf "Do you want to install slstatus? (y/n): " # using printf instead of 'echo' to avoid newline, -n flag for 'echo' is not supported in POSIX - read -r response # -r flag to prevent backslashes from being interpreted - case "$response" in - [Yy] | [Yy][Ee][Ss]) # Matches: Y, y, Yes, yes, YES, yEs, yeS, etc. - echo "Installing slstatus" - cd slstatus/ || { echo "Failed to change directory to slstatus"; return 1; } - if $ESCALATION_TOOL make clean install; then - echo "slstatus installed successfully" - else - echo "Failed to install slstatus" - return 1 - fi - ;; - [Nn] | [Nn][Oo]) # same logic as above, but for No - echo "Skipping slstatus installation" - ;; - *) - echo "Invalid input. Please enter y/yes or n/no." - install_slstatus - ;; - esac + while true; do + printf "Do you want to install slstatus? (y/n): " # using printf instead of 'echo' to avoid newline, -n flag for 'echo' is not supported in POSIX + read -r response # -r flag to prevent backslashes from being interpreted + case "$response" in + [Yy] | [Yy][Ee][Ss]) # Matches: Y, y, Yes, yes, YES, yEs, yeS, etc. + echo "Installing slstatus" + cd slstatus/ || { echo "Failed to change directory to slstatus"; return 1; } + if $ESCALATION_TOOL make clean install; then + echo "slstatus installed successfully" + else + echo "Failed to install slstatus" + return 1 + fi + break + ;; + [Nn] | [Nn][Oo]) # same logic as above, but for No + echo "Skipping slstatus installation" + break + ;; + *) + echo "Invalid input. Please enter y/yes or n/no." + ;; + esac + done cd .. } From 3026b757e078fd1f768045917f73279e61c676a2 Mon Sep 17 00:00:00 2001 From: Mayur Raut <95993675+RazoBeckett@users.noreply.github.com> Date: Sun, 15 Sep 2024 19:16:43 +0530 Subject: [PATCH 3/5] feat(dwmtitus-setup): simplified --- tabs/applications-setup/dwmtitus-setup.sh | 38 +++++++++-------------- 1 file changed, 14 insertions(+), 24 deletions(-) diff --git a/tabs/applications-setup/dwmtitus-setup.sh b/tabs/applications-setup/dwmtitus-setup.sh index 961e8892..e5e954ac 100755 --- a/tabs/applications-setup/dwmtitus-setup.sh +++ b/tabs/applications-setup/dwmtitus-setup.sh @@ -296,30 +296,20 @@ setupDisplayManager() { } install_slstatus() { - while true; do - printf "Do you want to install slstatus? (y/n): " # using printf instead of 'echo' to avoid newline, -n flag for 'echo' is not supported in POSIX - read -r response # -r flag to prevent backslashes from being interpreted - case "$response" in - [Yy] | [Yy][Ee][Ss]) # Matches: Y, y, Yes, yes, YES, yEs, yeS, etc. - echo "Installing slstatus" - cd slstatus/ || { echo "Failed to change directory to slstatus"; return 1; } - if $ESCALATION_TOOL make clean install; then - echo "slstatus installed successfully" - else - echo "Failed to install slstatus" - return 1 - fi - break - ;; - [Nn] | [Nn][Oo]) # same logic as above, but for No - echo "Skipping slstatus installation" - break - ;; - *) - echo "Invalid input. Please enter y/yes or n/no." - ;; - esac - done + printf "Do you want to install slstatus? (y/N): " # using printf instead of 'echo' to avoid newline, -n flag for 'echo' is not supported in POSIX + read -r response # -r flag to prevent backslashes from being interpreted + if [ "$response" = "y" ] || [ "$response" = "Y" ]; then + echo "Installing slstatus" + cd slstatus/ || { echo "Failed to change directory to slstatus"; return 1; } + if $ESCALATION_TOOL make clean install; then + echo "slstatus installed successfully" + else + echo "Failed to install slstatus" + return 1 + fi + else + echo "Skipping slstatus installation" + fi cd .. } From 0ecfb64121192fb78076b547ae7bc9423f790aab Mon Sep 17 00:00:00 2001 From: RazoBeckett <95993675+RazoBeckett@users.noreply.github.com> Date: Sun, 15 Sep 2024 14:11:22 +0000 Subject: [PATCH 4/5] feat(dwmtitus-setup): use full path. Co-authored-by: Nyx <144965845+nnyyxxxx@users.noreply.github.com> --- tabs/applications-setup/dwmtitus-setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tabs/applications-setup/dwmtitus-setup.sh b/tabs/applications-setup/dwmtitus-setup.sh index e5e954ac..b58ecc3d 100755 --- a/tabs/applications-setup/dwmtitus-setup.sh +++ b/tabs/applications-setup/dwmtitus-setup.sh @@ -300,7 +300,7 @@ install_slstatus() { read -r response # -r flag to prevent backslashes from being interpreted if [ "$response" = "y" ] || [ "$response" = "Y" ]; then echo "Installing slstatus" - cd slstatus/ || { echo "Failed to change directory to slstatus"; return 1; } + cd "$HOME/dwm-titus/slstatus" || { echo "Failed to change directory to slstatus"; return 1; } if $ESCALATION_TOOL make clean install; then echo "slstatus installed successfully" else From c05ac33cb0c99659f72d81ff050c7d187318024d Mon Sep 17 00:00:00 2001 From: RazoBeckett <95993675+RazoBeckett@users.noreply.github.com> Date: Sun, 15 Sep 2024 14:12:23 +0000 Subject: [PATCH 5/5] feat(dwmtitus-setup): use $HOME using `$HOME` rather than `cd ..` Co-authored-by: Nyx <144965845+nnyyxxxx@users.noreply.github.com> --- tabs/applications-setup/dwmtitus-setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tabs/applications-setup/dwmtitus-setup.sh b/tabs/applications-setup/dwmtitus-setup.sh index b58ecc3d..6aecd8aa 100755 --- a/tabs/applications-setup/dwmtitus-setup.sh +++ b/tabs/applications-setup/dwmtitus-setup.sh @@ -310,7 +310,7 @@ install_slstatus() { else echo "Skipping slstatus installation" fi - cd .. + cd "$HOME" } checkEnv