aboutsummaryrefslogtreecommitdiff
path: root/install.sh
diff options
context:
space:
mode:
authorAditya <bluenerd@protonmail.com>2023-03-01 13:35:35 +0530
committerAditya <bluenerd@protonmail.com>2023-03-01 13:35:35 +0530
commitcdf3b60d3ef7fd60482a766896e13db9364ea142 (patch)
tree58f76a260142bb9221cce0e5669de8a942c3ad9b /install.sh
parentf1126289134deb24e62193276068cfbb18c5789b (diff)
keep config in user directory
Diffstat (limited to 'install.sh')
-rwxr-xr-xinstall.sh26
1 files changed, 12 insertions, 14 deletions
diff --git a/install.sh b/install.sh
index eb26b1d..ae41015 100755
--- a/install.sh
+++ b/install.sh
@@ -17,30 +17,28 @@
DWMBAR="/usr/bin/dwmbar"
-if [ "$EUID" -ne 0 ]
- then echo "Please run as root" > /dev/stderr
- exit 1
-fi
+#if [ "$EUID" -ne 0 ]
+# then echo "Please run as root" > /dev/stderr
+# exit 1
+#fi
if [[ ! -f "dwmbar" ]]; then
echo "dwmbar executable not found." > /dev/stderr
exit 1
fi
-# Create /usr/share/dwmbar
+# Create ~/.config/dwmbar
# Containing example bar.sh and modules
-mkdir --parents "/usr/share/dwmbar/"
+DWMBAR_CONF="/home/$USER/.config/dwmbar"
+
+mkdir -pv $DWMBAR_CONF
-echo "./modules --> /usr/share/dwmbar/modules"
-cp -rT "./modules" "/usr/share/dwmbar/modules"
+cp -vrfT "./modules" "$DWMBAR_CONF/modules"
-echo "./bar.sh --> /usr/share/dwmbar/bar.sh"
-cp "./bar.sh" "/usr/share/dwmbar/bar.sh"
+cp -vf "./bar.sh" "$DWMBAR_CONF/bar.sh"
-echo "./config --> /usr/share/dwmbar/config"
-cp -r "./config" "/usr/share/dwmbar/config"
+cp -vr "./config" "$DWMBAR_CONF/config"
-echo "./dwmbar --> /usr/bin/dwmbar"
-cp "./dwmbar" "/usr/bin/dwmbar"
+sudo cp -vf "./dwmbar" $DWMBAR
[[ $? -eq 0 ]] && echo "Installation completed successfully"