diff options
author | 2022-03-15 00:24:12 +0530 | |
---|---|---|
committer | 2022-03-15 00:24:12 +0530 | |
commit | 4e5d83326d0094b2c344abbf598c14d04c28260b (patch) | |
tree | 7bc790cede04f61860e3e5bf811f557c8a601253 | |
parent | ab19ed42e1495bf83434ea6dd68b8df755913320 (diff) | |
download | shopno-os-log-sync-4e5d83326d0094b2c344abbf598c14d04c28260b.tar.gz shopno-os-log-sync-4e5d83326d0094b2c344abbf598c14d04c28260b.zip |
(xprofile) | changing aproach to install/run watch_log script | adding install uninstall script
-rw-r--r-- | README.md | 19 | ||||
-rwxr-xr-x | install | 36 | ||||
-rw-r--r-- | install-systemd.bash | 18 | ||||
-rwxr-xr-x | uninstall | 13 |
4 files changed, 61 insertions, 25 deletions
@@ -1,4 +1,4 @@ -# Watcher +# Watcher ### Minimal Open source Screen-Time Tracker (CLI-app) <img src="https://cdn.discordapp.com/attachments/846673042893832195/952274599276580874/watcher.png" width=90% height=auto> @@ -9,7 +9,7 @@ - [Installation](#installation) - [Todo](#to-do) -## About +## About Watcher is CLI-app (at this moment) which helps you to get perspective about your Screen-time ## Gallery @@ -17,14 +17,19 @@ Day Summary | Week Summary :-------------------------:|:-------------------------:  |  -Note: You might be thinking how can someone has 14hrs of screen time in a single day, Well ! short ans is AFK-feature is not implemented yet +Funfact: You might be thinking how can someone has 14 hrs of screen time in a single day, Well ! short ans is AFK-feature is not implemented yet... Most of the time I left my laptop as it is so it also counts that AFK time as Screen-time ## Installation -Just clone this repo somewhere in your computer and cd into it and run install script according to your init system -```bash -$ bash ./install-[init-system].bash +* Note: Install [```xdotool```](https://github.com/jordansissel/xdotool) on your system ( its the only dependancy ) +* First, Clone this repository and cd into it- +```bash +$ git clone https://github.com/Waishnav/Watcher +$ cd ./Watcher/ +``` +* Then run install script +```bash +$ ./install ``` -for now manually add this path ```~/.local/bin/``` to your respective shell (bash, fish, zsh whatever) ## To-do - [ ] AFK feature @@ -0,0 +1,36 @@ +#!/bin/bash + +echo "[*] Thanks for landing here." +sleep 2s +echo "[*] First off all Watcher uses very less resources like alomost 10 MBs." +sleep 3s +echo "[*] Also some of the features are in development like AFK" +sleep 2s +echo "[*] So let's start installtion process... " + +sudo cp -r ./src/Watcher /usr/share/ +cp -r ./src/bin/watcher /usr/local/bin/ +sudo chmod +x /usr/local/bin/watcher + +# making directory for log-files (where all you daily logs are stored) +mkdir -p ~/.cache/Watcher/ +mkdir -p ~/.cache/Watcher/raw_data/ +mkdir -p ~/.cache/Watcher/Analysis/ + +# checking wherther is ~/.xprofile is sourced in ~/.xintrc or not +count1=$(grep -c "xprofile" $HOME/.xinitrc) +echo $count1 +# checking whether user have used watcher before +count2=$(grep -c "watcher --start" $HOME/.xprofile) + +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 +fi + +echo "Now you can use Watcher after restart. and see you around if anything goes wrong do PR or smth else" diff --git a/install-systemd.bash b/install-systemd.bash deleted file mode 100644 index 546dba3..0000000 --- a/install-systemd.bash +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -sudo cp -r ./src/Watcher /usr/share/ -mkdir -p ~/.local/bin/ -cp -r ./src/bin/watcher ~/.local/bin/ -sudo chmod +x ~/.local/bin/watcher - -# enabling systemd service -mkdir -p ~/.config/systemd/ -mkdir -p ~/.config/systemd/user/ -cp -r ./src/service/watcher.service ~/.config/systemd/user/ -systemctl --user enable --now watcher.service - -# making directory for log-files (where all you daily logs are stored) -mkdir -p ~/.cache/Watcher/ -mkdir -p ~/.cache/Watcher/raw_data/ -mkdir -p ~/.cache/Watcher/Analysis/ - diff --git a/uninstall b/uninstall new file mode 100755 index 0000000..16b93db --- /dev/null +++ b/uninstall @@ -0,0 +1,13 @@ +#!/bin/bash +sudo rm -rf /usr/share/Watcher/ +sudo rm -rf /usr/local/bin/watcher + +echo "Do you want to delete your raw_data files?? y or n (default: n)" +read yes_or_no + +if [[ $yes_or_no = y ]]; then + rm -rf ~/.cache/Watcher/ +else + echo "Nice Decision either way you might use this app in future" +fi + |