aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Waishnav <waishnavdeore@gmail.com>2022-07-14 11:27:30 +0530
committerLibravatar Waishnav <waishnavdeore@gmail.com>2022-07-14 11:27:30 +0530
commitc927f1f3694b90573373e07230730ec9b8e6a18c (patch)
tree29eae37aa5488aaeef301521cf965feaaa31cc45
parent27365936982c5e3fcab51f5d0f93ff4feea687ef (diff)
downloadshopno-os-log-sync-c927f1f3694b90573373e07230730ec9b8e6a18c.tar.gz
shopno-os-log-sync-c927f1f3694b90573373e07230730ec9b8e6a18c.zip
fixing typo
-rw-r--r--README.md2
-rwxr-xr-xsrc/Watcher/get_windows.py3
2 files changed, 3 insertions, 2 deletions
diff --git a/README.md b/README.md
index 5197f23..353c5a3 100644
--- a/README.md
+++ b/README.md
@@ -36,5 +36,5 @@ $ chmod +x ./install && ./install
```
## To-do
-- [ ] AFK feature
+- [x] AFK feature
- [ ] GUI only if got 300 stars Probably [Tauri App](https://github.com/tauri-apps/tauri).
diff --git a/src/Watcher/get_windows.py b/src/Watcher/get_windows.py
index 65e8a93..85e9bd8 100755
--- a/src/Watcher/get_windows.py
+++ b/src/Watcher/get_windows.py
@@ -14,7 +14,7 @@ def active_window_title():
# get classname of app that user working on
def active_window():
- active_window = os.popen("xprop -id $(xdotool getactivewindow) | grep CLASS | awk '{print $4}'").read()[:-1].replace('''"''', "")
+ active_window = os.popen("xprop -id $(xdotool getactivewindow) | grep CLASS ").read()[19:-1].replace('''"''', "").split(", ")[0]
if "XGetWindowProperty[_NET_ACTIVE_WINDOW] failed" in active_window:
active_window = ""
@@ -49,6 +49,7 @@ def is_window_changed(a, afk, timeout):
return result
+print(active_window())
### what to do after window get change I've to append one line in csv data file in following format
### opened-time closed-time time-spent window_class_name window_title_name