Skip to the page

SNAPPASTE

Rust and Kotlin

Personal Project

Screenshot. Ctrl+V. Done. SnapPaste, github.com/kirtanjoshi/SnapPaste

चित्रchitraa pictureNepali

Written in Ranjana, the calligraphic script of the Newars of the Kathmandu Valley.

SnapPaste puts a screenshot taken on an Android phone straight onto a Windows clipboard. Take it, press Ctrl+V on the PC, and it is there in about a tenth of a second, down the USB cable, with no cloud in between.

See the code on GitHub
Role
Design and build, alone
Kind
Personal tool
Desktop
Rust, windows-rs, tray-icon
Android
Kotlin, coroutines
Transport
Raw TCP over USB
Begun
July 2026

The idea in twenty seconds

A short film of the whole tool: take the screenshot, press two keys, and see what happens in between.

Screenshot. Ctrl+V. Done.

Now you try

Take a screenshot on the phone, then press Ctrl+V on your own keyboard.

A phone showing the home screen of the Daily Dazzle app
New message

Nothing to paste yet.

Take a screenshot on the phone, then press Ctrl+V.

Twenty bytes first

Every packet opens with the same header, drawn here to scale. Select a field to see what it is for.

Magic

Bytes 0 to 3 of 20, little-endian

The same four bytes open every packet. Anything else that wanders onto the port is turned away at once.

How it is built

Thirteen decisions, from the phone to the wire to the PC, tipped out of the box.

Android, 1 of 13

MediaStore observer

A ContentObserver on the phone's MediaStore hears of a new screenshot within milliseconds, on a handler thread of its own. Nothing polls.

Touch a label to read it.

Budgets, and what it spends

Each limit was written down before the code was. The right-hand column is what it measured in real use.

WhatBudgetMeasured
Screenshot to clipboardunder 150 ms60 to 110 ms
Clipboard updateunder 20 ms8 to 14 ms
Cold startunder 300 ms45 ms
Memory when idleunder 15 MB8.8 MB
Processor when idleunder 1%0%
Back after a dropped cableunder 2 s1.1 s

GET IN
TOUCH

Write to me
LinkedinGithubInstagram