Very cool! Thanks for this. I haven't patched dmenu yet, but will probably do it first time I have to put something huge into the clipboard (I don't think I have that use case yet).
Everything else works great. Had to install xclip though. Cheers, Alex On 12/21/09, Nibble <nibble...@gmail.com> wrote: > Hi, > > Last weekend Delta and I were playing with dclip, fixing some bugs and > finally, we think there are no more corner cases handling selections. > For those of you, who don't know what dclip is: > > http://tecnoprawn.wordpress.com/2009/12/17/dclip/ > > dclip is a lightweight clipboard manager (19 LOC in sh) that uses dmenu > as frontend to show the stored selections and depends on xclip. It > tries to unify the mess with different X selections. > > For example in dwm, in order to copy with M+C+c and paste with M+C+v > you can add the following in your config.h: > > /* commands */ > static const char *dclipcmd[] = { "dclip", "paste", "-fn", font, "-nb", > normbgcolor, "-nf", normfgcolor, "-s b", selbgcolor , "-sf", > selfgcolor, NULL }; > > and in the keys[] section: > > { MODKEY|ControlMask, XK_c, spawn, SHCMD("exec dclip copy") }, > { MODKEY|ControlMask, XK_v, spawn, {.v = dclipcmd } }, > > Furthermore, using dclip I noticed that dmenu cannot create items larger > than 1024 bytes, so I've modified the function readstdin in order > to solve this issued. It was very bouring to copy a selection larger > than 1024 chars with dclip and then have to paste several items from > dmenu instead of just one. > > I attached the patch for dmenu-4.0 (last stable release) and dmenu-tip > and the last release of dclip. > > Kind regards, > -- Nibble