GPaste
GPaste copied to clipboard
Method to replace text in clipboard?
First off thank you for this fine piece of software, I know it's not simple to maintain something like this for so long.
That said I'm curious if adding a way to replace text in the clipboard buffer exists or could be added? Dug through closed issues and couldn't find anything like it
the scenario is a commonly copied string of text that I need to replace part of to use elsewhere, would be nice if this happened automatically
happy to offer support where I can -- don't have much background with desktop software but been pushing code for a long time
Hi, You can edit any element you want from your history, including the active one using the gui.
gpaste-client ui
or hitting <Ctrl><Alt>G
should spawn it.
what I'm really looking for is a method to trigger the replacement
ie: if <pattern_match>
then run <sed>
For now you could do something like
gpaste-client replace 8 "$(gpaste-client get 8 | sed s/foo/bar/g)"
That should work to replace foo by bar in the 8th item
cool, though doesn't cover my desired feature
given a pointer for where in the code base to add a hook would be appropriate I'm happy to work on a prototype (though may take a while)
Oh, now I think I get it. You want for eample that every time there is "foobar" in what you copy, gpaste automatically transforms it into "waldo" and put the result in the clipboard? If so, the right place would probably be inside g_paste_history_add in src/libgpaste/core/gpaste-history.c No idea how to make it easily configurable though.