aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md19
-rwxr-xr-xinstall36
-rw-r--r--install-systemd.bash18
-rwxr-xr-xuninstall13
4 files changed, 61 insertions, 25 deletions
diff --git a/README.md b/README.md
index 5759b11..1c3959f 100644
--- a/README.md
+++ b/README.md
@@ -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
:-------------------------:|:-------------------------:
![](https://cdn.discordapp.com/attachments/846673042893832195/952283314746691624/unknown.png) | ![](https://cdn.discordapp.com/attachments/846673042893832195/952283190716948521/unknown.png)
-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
diff --git a/install b/install
new file mode 100755
index 0000000..63cd111
--- /dev/null
+++ b/install
@@ -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
+