Bi-directional drag and drop source / target
Key features:
- Run
dnd
without arguments and blank window with target area appears - Run
dnd
with arguments, e.g.dnd file1.txt file2.html
,dnd *
or pipe into it likefind . -name "*.txt" | dnd file2.html
and window with both drag and drop source files & target area appears - Configure default options (flags) in
dnd.cfg
file located in the same directory as the executable or~/.config/dnd/dnd.cfg.
(after installation) so you dont have to type them every time - Save different setting presets in
dnd.cfg
and switch between them by running the program likednd --preset=Alt
- Run
dnd --help
to see all options or look at usage below - You can quit by hitting
Esc
orQ
key also
- GTK+ 3
- GTK+ 3 dev packages
- Nim compiler 1.6.2+
- gintro (automatically downloaded via nimble)
You can install it via 2 methods:
- Manual (Makefile) - Nim not required (when not building)
- Nim's package manager
nimble
Download the latest release and unpack it to a folder (tar -zxf FILENAME
)
To install:
make install
To uninstall:
make uninstall
dnd
executable is installed to~/.local/bin/dnd
dnd.cfg
is installed to~/.config/dnd/dnd.cfg
- Desktop entry is installed to
~/.local/share/applications/dnd.desktop
- Icon
dnd.xpm
is installed to~/.local/share/icons/dnd.xpm
nimble install dnd
dnd
symlink is installed to~/.nimble/bin/dnd
and executable to~/.nimble/pkgs/dnd-VERSION/dnd
dnd.cfg
is installed to~/.nimble/pkgs/dnd-VERSION/dnd.cfg
- Desktop entry is installed to
~/.local/share/applications/dnd.desktop
-nimble uninstall dnd
cannot remove it automatically? - Icon
dnd.xpm
is installed to~/.nimble/pkgs/dnd-VERSION/resources/dnd.xpm
dnd - bi-directional drag and drip source / target
Usage: dnd [options] [file...]
-a, --all=true Drag all files at once
-k, --keep=true Keep dropped files in for a drag out
-t, --top=true Keep the program window always on top
-c, --center-mouse=true Center the program on the mouse
-C, --center-screen=true Center the program in the middle of the screen
-f=NAME, --cfg=NAME Load a different config file
-p=NAME, --preset=NAME Load different preset from config file
-d, --decorated=true Let the program window be decorated by the window manager
-o=FLOAT, --opacity=FLOAT Change the program window opacity
-v, --version Show version info
-h, --help Show this message
Presets in current loaded dnd.cfg file:
[Default]
w = 200 # Width
h = 200 # Height
keep = false
always_on_top = true
center_mouse = false
center_screen = true
decorated = true
opacity = 1.0
dnd
- shows a blankdnd
window with drag-and-drop area, drag media into it and an URL/URI address is printed tostdout
dnd *
- shows a drag area for every file in the folder and drop area at the bottomdnd .
- shows a drag area for the current folder and drop area at the bottomdnd file1 file2
- shows a drag area forfile1
,file2
and drop area at the bottomfind . -name "*.txt" | dnd file2.html
- shows a drag area forfile.html
, every file output by the pipe (everytxt
file in current folder and subfolders) and drop area at the bottomdnd | while read url; do wget "$url"; done
- drag media from browser (a picture) intodnd
drop area, it captures the URL address and useswget
to download the media to current folder (also inexamples/dnd_wget.sh
)
Thanks to mwh and his dragon for inspiration and Dr. Stefan Salewski for help with GTK and gintro.
GNU GPL version 3