aboutsummaryrefslogtreecommitdiff
path: root/install
diff options
context:
space:
mode:
authorLibravatar Waishnav <waishnavdeore@gmail.com>2022-03-22 10:55:32 +0530
committerLibravatar Waishnav <waishnavdeore@gmail.com>2022-03-22 10:55:32 +0530
commitf4104f2a2bbeed7471ceb3f2feaf8f08084b08cf (patch)
tree1663a81db8ab4dbed9bd35b83e73a75188998477 /install
parent098a0ff12f4970eff17e8c841fc4ba81bf715a6e (diff)
downloadshopno-os-log-sync-f4104f2a2bbeed7471ceb3f2feaf8f08084b08cf.tar.gz
shopno-os-log-sync-f4104f2a2bbeed7471ceb3f2feaf8f08084b08cf.zip
sourcing .xprofile from .xinitrc at beginining of file
Diffstat (limited to 'install')
-rwxr-xr-xinstall27
1 files changed, 16 insertions, 11 deletions
diff --git a/install b/install
index 22623ce..53630ba 100755
--- a/install
+++ b/install
@@ -6,7 +6,7 @@ echo "[✔] And...FYI Watcher uses very less resources like almost 10 MBs."
sleep 2s
echo "[✔] Also some of the features are in development AFK is one of them"
sleep 2s
-echo "[✔] So let's start installtion process... "
+echo "[✔] So let's start installation process... "
sudo cp -r ./src/Watcher /usr/share/
echo "[✔] Copying Watcher to /usr/share/"
@@ -28,6 +28,7 @@ if [ -f "$HOME/.config/systemd/user/watcher.service" ]; then
rm -rf $HOME/.config/systemd/user/watcher.service
elif [ -f "$HOME/.local/bin/watcher" ]; then
rm -rf $HOME/.local/bin/watcher
+fi
# checking wherther is ~/.xprofile is sourced in ~/.xintrc or not
count1=$(grep -c "xprofile" $HOME/.xinitrc)
@@ -39,15 +40,19 @@ else
fi
echo "[✔] Making sure that it will run at starting of each xsession afterward"
-if [[ $count1 > 0 ]];then
- if [[ $count2 = 0 ]];then
- echo "killall watcher" >> $HOME/.xprofile
- echo "watcher --start &" >> $HOME/.xprofile
- fi
-else
- echo "[ -f /etc/xprofile ] && . /etc/xprofile" >> $HOME/.xinitrc
- echo "[ -f ~/.xprofile ] && . ~/.xprofile" >> $HOME/.xinitrc
+
+if [ $count1 = 0 ] & [ $count2 = 0 ];then
+ sed -i '/bin/a \source ~/.xprofile' ~/.xinitrc
+ echo "killall watcher" >> $HOME/.xprofile
+ echo "watcher --start &" >> $HOME/.xprofile
+elif [ $count1 > 0 ] & [ $count2 = 0 ];then
+ echo "killall watcher" >> $HOME/.xprofile
+ echo "watcher --start &" >> $HOME/.xprofile
+elif [ $count2 > 0 ] & [ $count1 = 0 ];then
+ sed -i '/bin/a \source ~/.xprofile' ~/.xinitrc
fi
-echo "Now you can use Watcher after restart. and see you around 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"'''
+echo ""
+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' "