Skip to content

Latest commit

 

History

History
72 lines (50 loc) · 2.15 KB

auto-upload-screenshots.md

File metadata and controls

72 lines (50 loc) · 2.15 KB

Auto-upload screenshots

CloudApp and Droplr let me take a screenshot or a video of the screen, and insta-upload it to the cloud. How can we replicate that behavior?

Screenshots & Screencast

First we need something to actually take the screenshots.

  • macOS can use buil-in tools:

  • *nix can use 3rd party:

    • peek for screencast WEBM, MP4 and GIF
    • flameshot for screenshots (partial or full)
  • Windows 10 can use built-in shortcuts:

    • Win + Print Screen for a full screenshot
    • See this WikiHow for more options

2. Watching files

Ultimately we want a way to watch the screenshots folder for changes, then call s3-upload with the changed file paths.

For a great cross-platform filesystem watcher, try fswatch. You can try a command like this on start-up:

fswatch --event=Created --event=Updated "$HOME/screenshots" | s3-upload --stdin

You can specify one or more event types to watch:

NoOp
PlatformSpecific
Created
Updated
Removed
Renamed
OwnerModified
AttributeModified
MovedFrom
MovedTo
IsFile
IsDir
IsSymLink
Link
Overflow

Alternatives

On Linux you can use incron to automatically respond to filesystem changes with arbitrary commands.

After installing incrond, add this code into /var/spool/incron/s3-upload:

/path/to/screenshots IN_CLOSE_WRITE s3-upload -CN $@/$#

Make sure your user owns the file:

chown "$(whoami)" /var/spool/incron/s3-upload

Annotation

Check out the guide on annotating screenshots.