-
Notifications
You must be signed in to change notification settings - Fork 12
/
install
executable file
·59 lines (51 loc) · 1.88 KB
/
install
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
#!/bin/bash
git clone https://github.com/Waishnav/Watcher -b v2.0 && cd Watcher
echo "[✔] First of all Thanks for dropping by!."
sleep 1s
echo "[✔] And...FYI Watcher uses very less resources like almost 10 MBs."
sleep 1s
echo "[✔] Also some of the features are in development AFK is one of them"
sleep 2s
echo "[✔] So let's start installation process... "
sudo cp -r ./src/Watcher /usr/share/
echo "[✔] Copying Watcher to /usr/share/"
sudo cp -r ./src/bin/watcher /usr/local/bin/
echo "[✔] Copying watcher executable to /usr/local/bin/"
sudo chmod +x /usr/local/bin/watcher
echo "[✔] Making it executable by giving it permission"
# making directory for log-files (where all you daily logs are stored)
mkdir -p ~/.cache/Watcher/
echo "[✔] To store raw_data making directory as ~/.cache/Watcher"
mkdir -p ~/.cache/Watcher/daily_data/
mkdir -p ~/.cache/Watcher/Analysis/
# deleting folowing lines "[ -f /etc/xprofile ] && . /etc/xprofile/" and "[ -f ~/.xprofile ] && . ~/.xprofile"
if [ -f "$HOME/.xinitrc" ];
then
sed -i '/xprofile/d' ~/.xinitrc
# checking wherther is ~/.xprofile is sourced in ~/.xintrc or not
count1=$(grep -c "xprofile" $HOME/.xinitrc)
else
count1=0
fi
# checking whether user have used watcher before as well as xprofile filed setup or not
if [ -f "$HOME/.xprofile" ];
then
count2=$(grep -c "watcher --start" $HOME/.xprofile)
else
count2=0
fi
echo "[✔] Making sure that it will run at startup of the system"
if [ $count2 = 0 ];
then
echo "watcher --start &" >> $HOME/.xprofile
fi
if [ -f "$HOME/.xinitrc" ];
then
if [ $count1 = 0 ] ;
then
echo "source ~/.xprofile" >> $HOME/.xinitrc
fi
fi
echo "Now you can use Watcher after restart. And see you around"
echo "If anything goes wrong do PR or open issue"
echo '''If you wanna just give a try (without restart), You can start taking logs (run watch_log.py) by 'watcher --start' '''