blob: f118c1d12cf57e667ad09c8d925830e756fe0be2 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
diff --git a/dwmbar b/dwmbar
index ba0de22..f896e0d 100755
--- a/dwmbar
+++ b/dwmbar
@@ -15,7 +15,7 @@
VERSION="1.0"
-DEFAULT_CONFIG_DIR="/usr/share/dwmbar"
+DEFAULT_CONFIG_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/_dwmbar"
export DEFAULT_CONFIG_DIR
DEFAULT_MODULES_DIR="$DEFAULT_CONFIG_DIR/modules/"
export DEFAULT_MODULES_DIR
@@ -51,7 +51,8 @@ print_help(){
copy_usr_to_home(){
mkdir -p "$CUSTOM_DIR"
- cp -r "$DEFAULT_CONFIG_LOCATION" "$CONFIG_DIR"
+ #cp -r "$DEFAULT_CONFIG_LOCATION" "$CONFIG_DIR"
+ install "$DEFAULT_CONFIG_LOCATION" "$CONFIG_DIR" -m 744
}
check_files(){
@@ -98,6 +99,11 @@ check_internet() {
fi
}
+if [[ ! -d "$CONFIG_DIR" ]]; then
+ echo "INSTALLING COZ CONFIG DONT EXISTS"
+ copy_usr_to_home
+fi
+
check_files
while :; do
diff --git a/install.sh b/install.sh
index c409bd2..26159ba 100755
--- a/install.sh
+++ b/install.sh
@@ -15,12 +15,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
-DWMBAR="/usr/bin/dwmbar"
-
-if [ "$EUID" -ne 0 ]
- then echo "Please run as root" > /dev/stderr
- exit 1
-fi
+INSTALL_LOCATION="$1/share"
+BIN_LOCATION="$1/bin"
if [[ ! -f "dwmbar" ]]; then
echo "dwmbar executable not found." > /dev/stderr
@@ -30,17 +26,17 @@ fi
# Create /usr/share/dwmbar
# Containing example bar.sh and modules
-mkdir --parents "/usr/share/dwmbar/"
+mkdir --parents "$INSTALL_LOCATION/dwmbar/"
-echo "./modules --> /usr/share/dwmbar/modules"
-cp -r "./modules" "/usr/share/dwmbar/modules"
+echo "./modules --> $INSTALL_LOCATION/dwmbar/modules"
+cp -r "./modules" "$INSTALL_LOCATION/dwmbar/modules"
-echo "./bar.sh --> /usr/share/dwmbar/bar.sh"
-cp "./bar.sh" "/usr/share/dwmbar/bar.sh"
+echo "./bar.sh --> $INSTALL_LOCATION/dwmbar/bar.sh"
+cp "./bar.sh" "$INSTALL_LOCATION/dwmbar/bar.sh"
-echo "./config --> /usr/share/dwmbar/config"
-cp -r "./config" "/usr/share/dwmbar/config"
+echo "./config --> $INSTALL_LOCATION/dwmbar/config"
+cp -r "./config" "$INSTALL_LOCATION/dwmbar/config"
-echo "./dwmbar --> /usr/bin/dwmbar"
-cp "./dwmbar" "/usr/bin/dwmbar"
+echo "./dwmbar --> $BIN_LOCATION/dwmbar"
+cp "./dwmbar" "$BIN_LOCATION/dwmbar"
[[ $? -eq 0 ]] && echo "Installation completed successfully"
diff --git a/modules/internet b/modules/internet
index 22cbd6a..0b17df1 100755
Binary files a/modules/internet and b/modules/internet differ
|