You are not logged in.

#1 2010-04-15 07:07:50

dmz
Member
From: Sweden
Registered: 2008-08-27
Posts: 881
Website

clipbored - daemon that collects all X clipboard buffers - use w dmenu

ldvx wanted something to manage all the X selections, and I suggested perl, dmenu and a plaintext file.
I thought it was a nice idea, so I made a daemon that sits and collects everything that goes to the buffer, so that one can use it at a later time.
You can use whatever you want to traverse the file and select what you want, but I've included two almost identical example scripts for use with dmenu.
When selecting an entry, it'll copied back to the clipboard, so one can use it again.

screenshot.png

screenshot-v.png
Site: http://github.com/trapd00r/clipbored
AUR: http://aur.archlinux.org/packages.php?ID=40090
Let me know what you think, and enjoy.

Last edited by dmz (2010-09-23 10:27:57)

Offline

#2 2010-04-15 07:43:32

ldvx
Member
Registered: 2007-01-02
Posts: 33

Re: clipbored - daemon that collects all X clipboard buffers - use w dmenu

Hi, I merely copied dmz's ideas and wrote a python + bash version of this proyect. It uses dmenu, xclip and crontab to run the script.

It anybody is intered it's here: http://github.com/ldvx/dmenuClip
Thanks to dmz for this cool app :-)

Offline

#3 2010-04-16 06:00:47

dmz
Member
From: Sweden
Registered: 2008-08-27
Posts: 881
Website

Re: clipbored - daemon that collects all X clipboard buffers - use w dmenu

Updated the scripts/ with dmenurl. Could be used as simple browser independent bookmarking.

screenshot-url.png

Offline

#4 2010-04-22 09:46:56

gladstone
Member
Registered: 2009-01-03
Posts: 74

Re: clipbored - daemon that collects all X clipboard buffers - use w dmenu

I'm getting:

Can't locate App/Daemon.pm in @INC

and can't find the perl package with that lib in.

OT: how would one go about finding it? I've been using: bauerbill -Ss --aur

Offline

#5 2010-04-22 10:38:39

dmz
Member
From: Sweden
Registered: 2008-08-27
Posts: 881
Website

Re: clipbored - daemon that collects all X clipboard buffers - use w dmenu

gladstone wrote:

I'm getting:

Can't locate App/Daemon.pm in @INC

and can't find the perl package with that lib in.

OT: how would one go about finding it? I've been using: bauerbill -Ss --aur

You could just issue;

# cpan App::Daemon

I dont know how bauerbill works.

Offline

#6 2010-09-23 07:15:40

jck
Member
From: USA
Registered: 2009-05-08
Posts: 98

Re: clipbored - daemon that collects all X clipboard buffers - use w dmenu

What is fmenu?

Offline

#7 2010-09-23 10:26:17

dmz
Member
From: Sweden
Registered: 2008-08-27
Posts: 881
Website

Re: clipbored - daemon that collects all X clipboard buffers - use w dmenu

Offline

#8 2010-09-24 08:54:41

tzervo
Member
From: Athens
Registered: 2009-04-03
Posts: 86

Re: clipbored - daemon that collects all X clipboard buffers - use w dmenu

Feature request :-)

Is it possible to add an option to track the primary selection as well (through a switch, or just track both?). I gave a glimpse to your script. It seems simple enough to alter it myself (although I dont know perl tongue), but then, whenever you make a neat improvement it will get overwritten.

Last edited by tzervo (2010-09-24 08:55:26)

Offline

#9 2010-09-24 08:58:40

dmz
Member
From: Sweden
Registered: 2008-08-27
Posts: 881
Website

Re: clipbored - daemon that collects all X clipboard buffers - use w dmenu

Hmm... but we are actually using the primary (XA_PRIMARY) selection. Could you elaborate?

Offline

#10 2010-09-24 09:21:42

tzervo
Member
From: Athens
Registered: 2009-04-03
Posts: 86

Re: clipbored - daemon that collects all X clipboard buffers - use w dmenu

My mistake, I thought that xclip -i gets clipboard by default, not primary. I marked something and fired up dmenu and misinterpreted the last selection not showing on the top of the list as not existing. Ignore my previous post.

Offline

#11 2010-09-25 16:34:39

0mark
Member
From: earth
Registered: 2010-06-09
Posts: 162
Website

Re: clipbored - daemon that collects all X clipboard buffers - use w dmenu

Very nice this one, especially dmenurl. Some litle feature request here, could the scripts use some (optional) environment variables to style dmenu/fmenu?

PS: I made a fmenu pkgbuild, although the project seems a bit dead. http://aur.archlinux.org/packages.php?ID=41112


Ceterum autem censeo Systemdinem esse delendam

Offline

#12 2010-09-25 18:56:44

dmz
Member
From: Sweden
Registered: 2008-08-27
Posts: 881
Website

Re: clipbored - daemon that collects all X clipboard buffers - use w dmenu

0mark wrote:

Very nice this one, especially dmenurl. Some litle feature request here, could the scripts use some (optional) environment variables to style dmenu/fmenu?

PS: I made a fmenu pkgbuild, although the project seems a bit dead. http://aur.archlinux.org/packages.php?ID=41112

Done.

$CLIPBORED_DMENU_FONT
$CLIPBORED_DMENU_NORMAL_FG
$CLIPBORED_DMENU_NORMAL_BG
$CLIPBORED_DMENU_SELECT_BG
$CLIPBORED_DMENU_SELECT_FG

Offline

#13 2010-09-25 19:13:06

anonymous_user
Member
Registered: 2009-08-28
Posts: 3,059

Re: clipbored - daemon that collects all X clipboard buffers - use w dmenu

Why is clipbored installed to a folder (/usr/lib/perl5/vendor_perl/bin) thats not in $PATH?

Also would it be possible for dmenuclip to list the most recent items first?

Last edited by anonymous_user (2010-09-25 19:15:24)

Offline

#14 2010-09-25 19:30:16

dmz
Member
From: Sweden
Registered: 2008-08-27
Posts: 881
Website

Re: clipbored - daemon that collects all X clipboard buffers - use w dmenu

Please ask that in https://bbs.archlinux.org/viewtopic.php?id=102242

That is not possible with dmenuclip, you can however use fmenuclip which does that by default.

Last edited by dmz (2010-09-25 19:32:52)

Offline

#15 2010-09-26 04:01:20

dmz
Member
From: Sweden
Registered: 2008-08-27
Posts: 881
Website

Re: clipbored - daemon that collects all X clipboard buffers - use w dmenu

anonymous_user wrote:

Also would it be possible for dmenuclip to list the most recent items first?

I might have misinterpreted you. Fixed.

Offline

#16 2010-09-26 05:01:17

anonymous_user
Member
Registered: 2009-08-28
Posts: 3,059

Re: clipbored - daemon that collects all X clipboard buffers - use w dmenu

Thank you, it works.

Offline

#17 2010-09-26 07:16:07

jck
Member
From: USA
Registered: 2009-05-08
Posts: 98

Re: clipbored - daemon that collects all X clipboard buffers - use w dmenu

There is no reason to use fmenu, vanilla dmenu supports vertical mode now.

Offline

#18 2010-09-26 07:38:45

dmz
Member
From: Sweden
Registered: 2008-08-27
Posts: 881
Website

Re: clipbored - daemon that collects all X clipboard buffers - use w dmenu

jck wrote:

There is no reason to use fmenu, vanilla dmenu supports vertical mode now.

Right. Removed fmenuclip and introduced two new env vars:

$CLIPBORED_DMENU_LISTMODE   # 'vertical' or anything else for default mode
$CLIPBORED_DMENU_LINES           # if this is defined, vertical mode will be used

Offline

#19 2010-11-17 15:54:56

Dieter@be
Forum Fellow
From: Belgium
Registered: 2006-11-05
Posts: 2,000
Website

Re: clipbored - daemon that collects all X clipboard buffers - use w dmenu

clipbored_users++;

I see you do both primary selection and clipboard.  I was wondering what happens when you put binary data in your clipboard (like copy an image or file), but I just realised I don't have any graphical filemanager so I can't test it big_smile


< Daenyth> and he works prolifically
4 8 15 16 23 42

Offline

#20 2010-11-18 14:01:06

dmz
Member
From: Sweden
Registered: 2008-08-27
Posts: 881
Website

Re: clipbored - daemon that collects all X clipboard buffers - use w dmenu

Dieter@be wrote:

clipbored_users++;

I see you do both primary selection and clipboard.  I was wondering what happens when you put binary data in your clipboard (like copy an image or file), but I just realised I don't have any graphical filemanager so I can't test it big_smile

Neither do I, but...

xclip foo.png
dmenuclip|display  <press enter>

Maybe one could do something cool with this knowledge...

Offline

#21 2010-11-18 14:15:04

Dieter@be
Forum Fellow
From: Belgium
Registered: 2006-11-05
Posts: 2,000
Website

Re: clipbored - daemon that collects all X clipboard buffers - use w dmenu

dmz wrote:
Dieter@be wrote:

clipbored_users++;

I see you do both primary selection and clipboard.  I was wondering what happens when you put binary data in your clipboard (like copy an image or file), but I just realised I don't have any graphical filemanager so I can't test it big_smile

Neither do I, but...

xclip foo.png
dmenuclip|display  <press enter>

Maybe one could do something cool with this knowledge...

interesting.  to my surprise clipbored doesn't totally crash.
it is however, a bit inconvenient that the binary data is stored as-is, in the plaintext clips file.  I think this will give issues if the binary data contains bits corresponding to newlines, then clipbored will think it's a new entry.
so I thought about solutions: maybe storing binary data in separate files, or storing them in in the clips file something as "data:<base64encodeddatahere>", I think it's fairly trivial to encode/decode (at least in the scripting languages I've worked with)

then in the selection part, I would make "dmenuclip" only return textual data (lines not matching "^data:"), then you can have additional scripts like dmenuimage for only images.  But that would get out of hand, because there are too many possibilities.
Luckily the `file` program can read from stdin; so it's trivial to store the filetype along with the actual data.  So for binary data, what about a 2-phase dmenu?  First you select which filetype you want (you need to choose between all the file types from your stored binary clips), and then a 2nd dmenu that shows you the actual entries.  Although now I think about it, it's pretty hard to "show" images and other binaries in dmenu.. maybe exif data or other tags... or maybe dmenu is not very suited anymore and we need separate "image-selectors"...


< Daenyth> and he works prolifically
4 8 15 16 23 42

Offline

#22 2010-11-26 00:40:04

Rasi
Member
From: Germany
Registered: 2007-08-14
Posts: 1,914
Website

Re: clipbored - daemon that collects all X clipboard buffers - use w dmenu

wow.. thanks for this tool....  i cant think of anything better for my subtle WM smile


He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife.

Douglas Adams

Offline

Board footer

Powered by FluxBB