A command-line tool to automatically take screenshots in the background and save them locally and/or upload to Google Drive.
β¨ Automatic Screenshots - Take screenshots at custom intervals π Local Storage - Save to a folder on your system βοΈ Google Drive Upload - Optionally upload to your Google Drive π Smart Error Handling - Automatic retries with circuit breaker pattern πΌοΈ Region Selection - Capture full screen or specific area βοΈ GUI Configuration - Easy settings dialog from system tray π YAML Configuration - Simple config file for all settings β° Flexible Scheduling - Configure intervals from 10 seconds to hours π·οΈ Timestamped Files - Each screenshot has a unique timestamp π¨ System Tray Integration - Control from Windows system tray
- Create a virtual environment with a supported Python version (Python 3.13 is recommended for this project):
uv venv --python 3.13
uv pip install -r requirements.txt- Create your local configuration file before running the app:
copy config.example.yaml config.yamlThen edit config.yaml and set your own local paths and preferences.
config.yamlis required at runtime. The project will not create a fallback config automatically.If you use Python 3.14 on Windows, Pillow may fail to build from source during installation.
- (Optional) Setup Google Drive integration:
- Follow the guide in docs/GDRIVE_SETUP.md
- You'll need a
credentials.jsonfile from Google Cloud Console
Double-click: start_screenshots_silent.vbs
Features:
- β NO abre ventana - completamente invisible
- πΈ Camera icon appears in system tray (bottom-right)
βΆοΈ Right-click icon to Start/Pause/Stop- βοΈ Settings menu - Configure interval, folders, Google Drive
- π See screenshot count and status
- β Quit from tray menu
Method 1: GUI Settings (Recommended)
- Start the app (double-click
start_screenshots_silent.vbs) - Right-click the system tray icon
- Select "βοΈ Settings"
- Configure interval, folders, Google Drive
- Save and restart the app
Method 2: Edit your local config
- Copy config.example.yaml to
config.yaml - Edit your local
config.yamlwith your own paths and settings - Keep
config.yamlout of Git (it is ignored by default) - The app expects this file to exist and be valid before it starts
Example values:
screenshot:
interval: 60 # Seconds between screenshots
prefix: "screenshot" # Filename prefix
local_folder: "C:/Users/your-user/Pictures/Screenshots"
google_drive:
enabled: false # Set to true only after Google Drive is configured
folder: "BG_Screenshots"Double-click: start_screenshots_on_taskmanager.vbs
- β NO abre ventana - completamente invisible
β οΈ To stop: Task Manager β End "pythonw.exe"
start_screenshots.bat- Simple backgroundstart_screenshots_tray.bat- System Tray- Use .vbs files instead for invisible launch
Take a single screenshot:
.\.venv\Scripts\python screenshot_capture.py -sSaves to: E:\Users\maracudev\OneDrive\ImΓ‘genes\BG_Screenshots
Take screenshots continuously (every 60 seconds):
.\.venv\Scripts\python screenshot_capture.pyCustom interval (every 30 seconds):
.\.venv\Scripts\python screenshot_capture.py -i 30Save to a different folder:
.\.venv\Scripts\python screenshot_capture.py -f "MyFolder"Custom folders are saved relative to Desktop
Upload single screenshot to Google Drive:
.\.venv\Scripts\python screenshot_capture.py -s -gSystem Tray with Google Drive (recommended):
.\.venv\Scripts\python screenshot_tray.py -gDouble-click start_screenshots_tray.bat for easy access.
Continuous with Google Drive upload:
.\.venv\Scripts\python screenshot_capture.py -g -i 60Custom Google Drive folder:
.\.venv\Scripts\python screenshot_capture.py -g -gf "WorkScreenshots"By default, screenshots upload to a folder named "BG_Screenshots" in your Google Drive
Take specific number of screenshots:
.\.venv\Scripts\python screenshot_capture.py -c 10 -i 30Custom local folder and prefix:
.\.venv\Scripts\python screenshot_capture.py -f "MyScreenshots" -p "capture"| Option | Description | Default |
|---|---|---|
-i, --interval |
Interval between screenshots (seconds) | 60 |
-f, --folder |
Custom folder name (relative to Desktop) | Screenshots (OneDrive path) |
-p, --prefix |
Prefix for screenshot filenames | screenshot |
-c, --count |
Number of screenshots to take (0 = infinite) | 0 |
-s, --single |
Take a single screenshot and exit | - |
-g, --gdrive |
Upload screenshots to Google Drive | - |
-gf, --gdrive-folder |
Google Drive folder name | BG_Screenshots |
# Take screenshots every 5 minutes
.\.venv\Scripts\python screenshot_capture.py -i 300
# Take 20 screenshots every 10 seconds, upload to Google Drive
.\.venv\Scripts\python screenshot_capture.py -c 20 -i 10 -g
# Single screenshot with custom prefix, upload to custom Drive folder
.\.venv\Scripts\python screenshot_capture.py -s -p "meeting" -g -gf "MeetingCaptures"
# Continuous with both local and cloud storage
.\.venv\Scripts\python screenshot_capture.py -i 120 -g -f "LocalBackup"Press Ctrl+C to stop taking screenshots when running in continuous mode.
For background execution:
- System Tray: Right-click icon β Quit
- Task Manager: End "pythonw.exe" process
All activity is logged to logs/screenshot_capture.log with automatic daily rotation:
- π Daily rotation - New log file created at midnight
- π¦ 30-day retention - Keeps last 30 days of logs automatically
- π Naming format - Rotated files:
screenshot_capture.log.YYYY-MM-DD - π Current log - Always in
screenshot_capture.log(today)
Log contents:
- Screenshot captures
- Google Drive uploads
- Errors and warnings
- Circuit breaker state changes
Quick view: Double-click view_log.bat to see:
- Last 50 entries from current log
- List of all historical log files
Log files example:
logs/
βββ screenshot_capture.log β Current (today)
βββ screenshot_capture.log.2026-05-26 β Yesterday
βββ screenshot_capture.log.2026-05-25 β 2 days ago
βββ ...
The app includes robust error handling for Google Drive uploads:
- π Automatic retries (3 attempts with exponential backoff)
- π΄ Circuit breaker - Temporarily disables uploads after repeated failures
- π’ Auto-recovery - Automatically resumes when service is back
- π Detailed error logging - All errors classified and logged
- πΎ Local backup - Screenshots ALWAYS saved locally, regardless of Drive status
See docs/ERROR_HANDLING.md for detailed information about the error handling system.
Circuit Breaker Status:
- Visible in System Tray menu
- Shows "β
Online", "
β οΈ Offline", or "π Testing" - Manual reset option when offline
The project includes a comprehensive test suite with 69% code coverage.
# Run all tests
uv run pytest tests/ -v
# Run with coverage report
uv run pytest tests/ --cov=. --cov-report=html
# View HTML coverage report
start htmlcov/index.html- β Configuration Management (97%)
- β Circuit Breaker Pattern (98%)
- β Error Handling & Retry Logic (100%)
- β Screenshot Capture (100% of testable code)
- β Region Selection (62%)
See tests/README.md for detailed testing documentation.
- π Google Drive Setup Guide - Complete OAuth setup instructions
- π§ Error Handling System - Circuit breaker and retry patterns
- βοΈ Authentication Comparison - OAuth vs API Keys vs Service Accounts
- π΄ Error 403 Fix - Troubleshoot access denied errors
- π₯οΈ Background Execution - Run as background process
- π Python Guidelines - Code style and best practices
- πͺ Pre-commit Guide - Git hooks setup and usage
Screenshots are saved as PNG files with timestamps in the format:
prefix_YYYYMMDD_HHMMSS.png
Example: screenshot_20260527_153000.png