From 92fd44066e64f02c111485fabb6b76aaceff5026 Mon Sep 17 00:00:00 2001
From: calin8u <alexis.calin9@etu.univ-lorraine.fr>
Date: Sun, 12 Feb 2023 19:37:06 +0100
Subject: [PATCH] better fool-proof

---
 install-sway.sh | 9 +++++++--
 setup.sh        | 5 +++--
 2 files changed, 10 insertions(+), 4 deletions(-)
 mode change 100644 => 100755 install-sway.sh

diff --git a/install-sway.sh b/install-sway.sh
old mode 100644
new mode 100755
index b089782..cea2af6
--- a/install-sway.sh
+++ b/install-sway.sh
@@ -1,3 +1,8 @@
-mkdir ~/.config/sway && mkdir ~/.config/foot
+if test -d ~/.config/sway; then 
+    echo "sway config directory already exist"
+else
+    mkdir ~/.config/sway && mkdir ~/.config/foot
+    cp sway/config ~/.config/sway/ && cp foot/foot.ini ~/.config/foot/
+
+fi 
 
-cp sway/config ~/.config/sway/ && cp foot/foot.ini ~/.config/foot/
\ No newline at end of file
diff --git a/setup.sh b/setup.sh
index ff8ca7d..87331a3 100755
--- a/setup.sh
+++ b/setup.sh
@@ -23,9 +23,10 @@ if [ "$distro" == "Debian" ]; then
     read yn
     if [ "$yn" == 'y' ]; then
         # dwm depedencies
-        apt install sway brightnessctl
+        sudo apt install sway brightnessctl
         #install bemenu
-        git clone https://github.com/Cloudef/bemenu && cd bemenu && make && make install && cd .. && rm bemenu
+        git clone https://github.com/Cloudef/bemenu && cd bemenu && make && sudo make install && cd .. && sudo rm -rf bemenu
+        chmod +x install-sway.sh
         ./install-sway.sh
     fi
     
-- 
GitLab