diff --git a/src/screenmonitor.py b/src/screenmonitor.py index 3523ea2..6db4a80 100644 --- a/src/screenmonitor.py +++ b/src/screenmonitor.py @@ -8,6 +8,8 @@ import pyautogui # Define the directory where screenshots will be saved output_dir = os.path.expanduser("~/.screenmonitor/output") +screenshotIntervalInMinutes = 17 + # Ensure the output directory exists os.makedirs(output_dir, exist_ok=True) @@ -66,8 +68,10 @@ def delete_old_screenshots(): def main(): while True: # Calculate the random time within the next 17-minute interval - next_interval_start = datetime.now() + timedelta(minutes=17) - random_seconds = random.randint(0, 17 * 60) + next_interval_start = datetime.now() + timedelta( + seconds=screenshotIntervalInMinutes * 60 + ) + random_seconds = random.randint(0, screenshotIntervalInMinutes * 60) random_time = datetime.now() + timedelta(seconds=random_seconds) # Sleep until the random time within the interval