Skip to content

Commit abcb7d0

Browse files
committed
Docs for the dnd kitten
1 parent 247ac6d commit abcb7d0

3 files changed

Lines changed: 59 additions & 1 deletion

File tree

docs/kittens/clipboard.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ clipboard
66
Overview
77
--------------
88

9-
*Copy/paste to the system clipboard from shell scripts*
9+
*Copy/paste to the system clipboard from shell scripts*
1010

1111
.. highlight:: sh
1212

docs/kittens/dnd.rst

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
Drag and Drop
2+
==================================================
3+
4+
.. only:: man
5+
6+
Overview
7+
--------------
8+
9+
*Drag and drop of files from the shell*
10+
11+
.. highlight:: sh
12+
13+
14+
The ``dnd`` kitten can be used to drag and drop files between
15+
the shell and arbitrary GUI programs, it even works over SSH, so you
16+
can easily and seamlessly transfer files from one computer to another,
17+
simply by dragging from one kitty window to another.
18+
Using it is as simple as::
19+
20+
kitten dnd file-to-drag.xyz
21+
22+
Then, start dragging with the mouse inside the window, and :file:`file-to-drag.xyz`
23+
will be dragged and you can drop it onto a GUI file manager or another window
24+
running this kitten. You can specify directories as well to drag entire trees.
25+
26+
Similarly, dropping works by running the kitten::
27+
28+
kitten dnd
29+
30+
Then, drag some files from a GUI file manager or another window running the dnd kitten
31+
and drop them onto this window. The files will be copied or moved (depending on
32+
which area you drop them) into the current working directory.
33+
34+
The best part is this works even over SSH. So if you just want to quickly
35+
transfer some files from one computer to another all you need to so is ssh into
36+
the remote computer::
37+
38+
kitten ssh remote-computer-name
39+
40+
Then, run the dnd kitten on the remote computer::
41+
42+
kitten dnd files-or-dirs-to-drag
43+
44+
That's it, you can now drag form or drop to the remote computer. See below for
45+
customising the behavior of the kitten via command line flags.
46+
47+
This kitten uses a new protocol developed by kitty to function, for details,
48+
see :doc:`/dnd-protocol`.
49+
50+
.. program:: kitty +kitten dnd
51+
52+
53+
.. include:: /generated/cli-kitten-dnd.rst

docs/kittens_intro.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Extend with kittens
1616
kittens/command-palette
1717
kittens/quick-access-terminal
1818
kittens/choose-files
19+
kittens/dnd
1920
kittens/panel
2021
kittens/remote_file
2122
kittens/hyperlinked_grep
@@ -74,6 +75,10 @@ Some prominent kittens:
7475
Preview and select files at the speed of thought
7576

7677

78+
:doc:`Drag and drop from the shell <kittens/dnd>`
79+
Drag and drop files from/to GUI programs from your shell, even over SSH
80+
81+
7782
:doc:`Remote file <kittens/remote_file>`
7883
Edit, open, or download remote files over SSH easily, by simply clicking on
7984
the filename.

0 commit comments

Comments
 (0)