An xdg URI handler for the non-standard copy: scheme. Opening
copy:<percent-encoded text> decodes the text and puts it on the clipboard.
Terminals that turn OSC 8 hyperlinks into clickable links route unknown
schemes through xdg-open. Registering copy-uri as the handler for copy:
turns a copy: link in a terminal into a one-click copy of whatever text it
encodes.
- Linux desktop with
xdg-utils(xdg-open,xdg-mime,update-desktop-database) - One of
wl-clipboard(wl-copy),xclip, orxsel perl, for percent-decoding
git clone https://github.com/jacobcheatley/copy-uri
cd copy-uri
./install.shThis installs copy-uri to ~/.local/bin and registers it as the default
handler for the copy: scheme.
xdg-open 'copy:hello%20world'The clipboard should now contain hello world.
Remove ~/.local/bin/copy-uri and
~/.local/share/applications/copy-uri.desktop. There is no need to reset
xdg-mime's default handler back to anything; deleting the desktop entry is
enough.
standup-cli emits copy:
links under reminder notes, so clicking one on a resumed task copies its
resume command to the clipboard. This only works in a terminal that opens OSC
8 hyperlinks through xdg-open.
MIT, see LICENSE.