Imported from bare git on Zurich
Go to file
James 202f771434 Fix findLatestScreenshot sorting by pre-fetching file info
The sort comparator was calling Info() and silently discarding errors,
which could cause nil dereferences or incorrect ordering. Pre-fetch
ModTime into a struct so the sort always has valid data.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 01:08:53 -05:00
.gitignore Initial commit 2026-02-01 08:04:10 +00:00
README.md Initial commit 2026-02-01 08:04:10 +00:00
com.inou.screenshot-server.plist Initial commit 2026-02-01 08:04:10 +00:00
main.go Fix findLatestScreenshot sorting by pre-fetching file info 2026-02-28 01:08:53 -05:00

README.md

Screenshot Server

Tiny HTTP server that serves the latest screenshot from ~/Desktop, then deletes it.

Build (on Mac)

cd /path/to/screenshot-server
go build -o screenshot-server

Install as service

# Copy binary
sudo cp screenshot-server /usr/local/bin/

# Install launchd service
cp com.inou.screenshot-server.plist ~/Library/LaunchAgents/

# Start it
launchctl load ~/Library/LaunchAgents/com.inou.screenshot-server.plist

# Check status
launchctl list | grep screenshot

Usage

Take a screenshot (Cmd+Shift+4), then:

curl http://192.168.1.14:9123/screenshot -o screenshot.png

Endpoints

  • GET /screenshot - Returns latest screenshot PNG, then deletes it
  • GET /health - Returns "ok"

Uninstall

launchctl unload ~/Library/LaunchAgents/com.inou.screenshot-server.plist
rm ~/Library/LaunchAgents/com.inou.screenshot-server.plist
sudo rm /usr/local/bin/screenshot-server

Logs

tail -f /tmp/screenshot-server.log