From 2a606b947dc318a783cfd202a446c03586a95cf4 Mon Sep 17 00:00:00 2001 From: Waishnav Date: Sat, 17 Sep 2022 05:09:46 +0530 Subject: updated algorithm | update csv at every second --- src/Watcher/get_windows.py | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'src/Watcher/get_windows.py') diff --git a/src/Watcher/get_windows.py b/src/Watcher/get_windows.py index 0769eb9..008defa 100755 --- a/src/Watcher/get_windows.py +++ b/src/Watcher/get_windows.py @@ -42,18 +42,10 @@ def active_window(): return active_window # returns true if user has move to next app which is not the same as previous -def is_window_changed(a, afk, timeout): - result = False - while not(result): - time.sleep(0.5) - b = active_window() - if a != b : - result = True - elif get_afk_status(afk, timeout): - result = True - else: - result = False - return result +def previous_window(array_of_window, active_window): + array_of_window.remove(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 -- cgit v1.2.3