You are not logged in.
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
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?
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Online
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
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.
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Online
Thx, but how can I rebind Ctrl+C ?
Offline
Unfortunately I don't know C programming, I know only Ruby and bash script.
Offline
Bind keys with Xbindkeys, or through your window manager.
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Online
ctrl + c would be a bad choice if you are copying from a terminal.
Offline
Yeah, I always use Ctrl + Insert, and I automatically interpreted Ctrl + C as Ctrl + Insert
Offline