diff options
author | 2022-07-14 11:27:30 +0530 | |
---|---|---|
committer | 2022-07-14 11:27:30 +0530 | |
commit | c927f1f3694b90573373e07230730ec9b8e6a18c (patch) | |
tree | 29eae37aa5488aaeef301521cf965feaaa31cc45 | |
parent | 27365936982c5e3fcab51f5d0f93ff4feea687ef (diff) | |
download | shopno-os-log-sync-c927f1f3694b90573373e07230730ec9b8e6a18c.tar.gz shopno-os-log-sync-c927f1f3694b90573373e07230730ec9b8e6a18c.zip |
fixing typo
-rw-r--r-- | README.md | 2 | ||||
-rwxr-xr-x | src/Watcher/get_windows.py | 3 |
2 files changed, 3 insertions, 2 deletions
@@ -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 |