aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLibravatar Waishnav <waishnavdeore@gmail.com>2022-09-17 06:37:49 +0530
committerLibravatar Waishnav <waishnavdeore@gmail.com>2022-09-17 06:37:49 +0530
commit9fd05fa5f70164aaa7df70bdf4b6b467f7108f22 (patch)
tree8941495dc2289a572bf42512d64987210670f8e3 /src
parent2a606b947dc318a783cfd202a446c03586a95cf4 (diff)
downloadshopno-os-log-sync-9fd05fa5f70164aaa7df70bdf4b6b467f7108f22.tar.gz
shopno-os-log-sync-9fd05fa5f70164aaa7df70bdf4b6b467f7108f22.zip
removed outdated comment
Diffstat (limited to 'src')
-rwxr-xr-xsrc/Watcher/get_windows.py16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/Watcher/get_windows.py b/src/Watcher/get_windows.py
index 008defa..c22d909 100755
--- a/src/Watcher/get_windows.py
+++ b/src/Watcher/get_windows.py
@@ -1,7 +1,13 @@
import os
import time
+import platform
from afk import get_afk_status
+if platform.system() == 'Windows':
+ from win32gui import GetWindowText, GetForegroundWindow
+elif platform.system() == 'Darwin':
+ import subprocess
+
# get title name of app that user working on
def active_window_title():
active_window_title = os.popen('''xprop -id $(xdotool getwindowfocus) WM_NAME''').read()[19:-2]
@@ -47,13 +53,3 @@ def previous_window(array_of_window, active_window):
array_of_window.append(active_window)
return l[-2]
-
-### 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
-
-### and whenever the user puts particular command it will make report till the time for that day and shows that report in terminal
-if __name__ == "__main__":
- while True:
- time.sleep(1)
- print(active_window_title())
- print(os.popen('''xdotool getwindowfocus getwindowname''').read())