aboutsummaryrefslogtreecommitdiff
path: root/src/Watcher/get_windows.py
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 /src/Watcher/get_windows.py
parent27365936982c5e3fcab51f5d0f93ff4feea687ef (diff)
downloadshopno-os-log-sync-c927f1f3694b90573373e07230730ec9b8e6a18c.tar.gz
shopno-os-log-sync-c927f1f3694b90573373e07230730ec9b8e6a18c.zip
fixing typo
Diffstat (limited to 'src/Watcher/get_windows.py')
-rwxr-xr-xsrc/Watcher/get_windows.py3
1 files changed, 2 insertions, 1 deletions
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