You are not logged in.

#1 2013-07-14 01:04:56

Konstantin_hu
Banned
Registered: 2012-05-14
Posts: 84
Website

Is there a scriptable clipboard manager for Arch Linux?

I mean I would like to make an event handler to run when data is copied to the clipboard (and an appropritae event handler is fired), and making some text processing on the clipboard data.

Offline

#2 2013-07-14 01:09:59

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 13,812
Website

Re: Is there a scriptable clipboard manager for Arch Linux?

This doesn't make sense to me.  There is xsel, but if you are writing an event handler, you must be using a language with Xlib bindings already - so why not access the selection data directly?


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Offline

#3 2013-07-14 01:25:41

Konstantin_hu
Banned
Registered: 2012-05-14
Posts: 84
Website

Re: Is there a scriptable clipboard manager for Arch Linux?

Currently I am using the Clipit clipboard manager, but I am looking for another one which fires an event when data is copied to the clipboard, and it runs an arbitrary script file which handles the event: eg process the data on the clipboard, replace parts of the text as necessary, runs through filters, regular expressions etc. This would be very helpful in some situations. You don't have to copy the text and paste it in a text editor, then replacing some text, copy again, and paste it on another document.

Offline

#4 2013-07-14 01:44:01

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 13,812
Website

Re: Is there a scriptable clipboard manager for Arch Linux?

I doubt something exactly like that exists yet, but if you know any C it would be pretty easy to make.

As an alternative, you could just bind a script to a key of choice that does the following:

xsel | sed 's/.../' | xsel -b -i

replace sed with awk, or whatever processing you'd want to do.  When you call this script (say you rebind Ctrl-C to call this script) whatever is currently selected will be processed, by sed in this case, and written to the clipboard.


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Offline

#5 2013-07-14 02:43:26

Konstantin_hu
Banned
Registered: 2012-05-14
Posts: 84
Website

Re: Is there a scriptable clipboard manager for Arch Linux?

Thx, but how can I rebind Ctrl+C ?

Offline

#6 2013-07-14 02:44:40

Konstantin_hu
Banned
Registered: 2012-05-14
Posts: 84
Website

Re: Is there a scriptable clipboard manager for Arch Linux?

Unfortunately I don't know C programming, I know only Ruby and bash script.

Offline

#7 2013-07-14 03:43:28

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 13,812
Website

Re: Is there a scriptable clipboard manager for Arch Linux?

Bind keys with Xbindkeys, or through your window manager.


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Offline

#8 2013-07-14 06:32:55

x33a
Forum Moderator
Registered: 2009-08-15
Posts: 3,349
Website

Re: Is there a scriptable clipboard manager for Arch Linux?

ctrl + c would be a bad choice if you are copying from a terminal.

Offline

#9 2013-07-26 05:55:30

Konstantin_hu
Banned
Registered: 2012-05-14
Posts: 84
Website

Re: Is there a scriptable clipboard manager for Arch Linux?

Yeah, I always use Ctrl + Insert, and I automatically interpreted Ctrl + C as Ctrl + Insert

Offline

Board footer

Powered by FluxBB