Dup Goto 📝

NetworkClipboards

PT2/lang/python/clipboard 02-23 12:37:45
To Pop
24 lines, 222 words, 1299 chars Monday 2026-02-23 12:37:45

I have two distinct network clipboard programs. One called Clipper, uses a Mysql backend in PHP accessed over http. The other, Bsrv, uses raw TCP sockets, and is ephemeral, though with the facility to dump and restore (but if it terminates, clips in memory are lost). Then I have a bsrv running in my Pi3, which are accessed via the aclient script, which sets the backend variable and then calls bclient.

Then I have a cman script (written by Gemini) which streamlines usage. I refer to aclient clips by prepending a comma, and cclient clips by prepending a ., and the clipboard is just referred to by .. Then cman has two subcommands, get and put, for the two most common cases with aclient and cclient. Then there are two one line bash scripts so that get is cman get, and put is cman put.

So e.g.

echo hello | put ,c    # put "hello" to bsrv clip "c"
get ,c -o ,d           # duplicate this clip to bsrv clip "d"
put -i ,d ,e ,f        # duplicate this clip to bsrv clips "e" and "f"
put -i . ,c            # paste into clip "c"
get ,c | sort | put ,c # pipe clip "c" through sort and replace