aboutsummaryrefslogtreecommitdiff
path: root/src/Watcher
diff options
context:
space:
mode:
Diffstat (limited to 'src/Watcher')
-rwxr-xr-xsrc/Watcher/afk.py2
-rwxr-xr-xsrc/Watcher/time_operations.py5
2 files changed, 6 insertions, 1 deletions
diff --git a/src/Watcher/afk.py b/src/Watcher/afk.py
index 2c54888..e309231 100755
--- a/src/Watcher/afk.py
+++ b/src/Watcher/afk.py
@@ -1,7 +1,7 @@
import os
def IsAFK():
time_since_last_input = int(os.popen("xprintidle").read())
- if time_since_last_input >= 3000:
+ if time_since_last_input >= 300000: # 3min no input == AFK
video_playback = os.popen("""pacmd list-sink-inputs | grep -w state | grep -i 'CORKED'""").read()
# if playback is not running as well as user is AFK
if "CORKED" in video_playback:
diff --git a/src/Watcher/time_operations.py b/src/Watcher/time_operations.py
index 23326d9..b7d3224 100755
--- a/src/Watcher/time_operations.py
+++ b/src/Watcher/time_operations.py
@@ -8,11 +8,16 @@ def time_difference(a,b): # b - a
sec = 60 + sec
if hr < 0:
hr = hr + 24
+
elif mn < 0 and sec >= 0:
hr = hr - 1
mn = 60 + mn
if hr < 0:
hr = hr + 24
+<<<<<<< HEAD
+
+=======
+>>>>>>> afk_feature
elif sec < 0 and mn > 0:
sec = 60 + sec
mn = mn - 1