Cross-Platform Screenshot Module Fix | Generated by AI
Fixed. No --linux flag needed — the platform is auto-detected.
What was changed in ww/image/screenshot.py:
-
Lazy Quartz import —
import Quartzmoved insidesys.platform == "darwin"branch instead of module top-level. This was the crash: Python tries to import all top-level names when the module is loaded, andQuartz(pyobjc) doesn’t exist on Linux. -
capture_screenshot()now works on Linux — falls back to_capture_linux()which tries scrot → ImageMagickimport→ gnome-screenshot → spectacle → ffmpeg x11grab. Same tool search order asscreenshot_linux.py. -
main()description updated — now says “macOS / Linux” instead of just “macOS”.
Result:
ww screenshot interact-note→ importscapture_screenshotwithout crashingww screenshot(no subcommand) → also works on Linux nowww screenshot-linux(the separate command with--no-save/--area) kept as-is — it has extra clipboard/quadrant features
The test showed the screenshot capture working (ImageMagick import via DISPLAY=:1), and the LLM step only failed because OPENROOTER_API_KEY isn’t set on this cloud box — not a code issue.
Want me to save this cross-platform pattern as a skill?