From f4104f2a2bbeed7471ceb3f2feaf8f08084b08cf Mon Sep 17 00:00:00 2001 From: Waishnav Date: Tue, 22 Mar 2022 10:55:32 +0530 Subject: sourcing .xprofile from .xinitrc at beginining of file --- install | 27 ++++++++++++++++----------- 1 file 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' " -- cgit v1.2.3