Urxvt pasting from clipboard.. efficient, fast, clean

All urxvt users know this problem: you cannot paste from X clipboard into urxvt.
There are various workarounds.  Many of them rely on synchronizing primary selection with clipboard (which I do not like.  I don't want to "lose" a buffer).  this can be in the form of autocutsel, or keybinds to do something like "xsel -bo | xsel -p", which has the additional disadvantage it requires an extra keyboard shortcut (one to sync the primary selection, one to do the actual paste).
I was wondering what would be a simple and clean way to paste the clipboard into urxvt (by using a -but only one- keyboard shortcut), without touching the primary selection.
I came up with putting this in my .xbindkeysrc
"xdotool type "$(xsel -bo)""
alt+Insert
But it's not perfect.  I also tried with --clearmodifiers.  If you try this out, you'll notice sometimes the paste will work, sometimes it will work half.  Sometimes it replaces existing text, sometimes it will do nothing, and the best part is sometimes if you do backspace or stuff like that it behaves differently, I actually messed up my keyboard events with this.
Anyone an idea for the "perfect" way to go?

realturner wrote:
I've just found this page recently and made a solution:
#! perl -w
# Usage:
# URxvt.perl-ext-common: clipboard
# URxvt.keysym.Mod4-c: perl:clipboard:copy
# URxvt.keysym.Mod4-v: perl:clipboard:paste
# consult command "xmodmap" to see what your modifier mapped into.
sub copy {
my ($self) = @_;
my $pid = open( pout, "| xsel -ib" ) or die "fork";
print pout $self->selection;
close(pout) or die "close";
sub paste {
my ($self) = @_;
my $content = `xsel -ob` ;
$self->tt_write ($content);
sub on_user_command {
my ($self, $cmd) = @_;
if ($cmd eq "clipboard:copy") {
$self->copy;
if ($cmd eq "clipboard:paste") {
$self->paste;
save this script as /usr/lib/urxvt/perl/clipboard
then add lines in ~/.Xdefaults:
URxvt.perl-ext-common: clipboard
URxvt.keysym.Mod4-c: perl:clipboard:copy
URxvt.keysym.Mod4-v: perl:clipboard:paste
should have a good work for copy/paste via Win+C/V
Edit: changed the method piping to xsel, avoid escape sequence problem.
wow! nice. thank you.
i didn't update this thread for a while, but i noticed that the earlier xdotool based solutions (including mine and Procyon's) sometimes just don't work, and I don't know why i will try this approach for a while
btw is there no recommed userspace location for urxvt scripts? otherwise, package your script please

Similar Messages

  • Cannot paste from clipboard. Cannot read the available clipboard formats.

    I cannot open a new or old pagemaker 6.5 document.  The message comes up 'cannot paste from clipboard.  Cannot read the available clipboard formats.
    It will not let you do anything and I have to close by Alt. Ctrl. Delete.
    Any help would be much appreciated.
    Linda

    Let me confirm what you're saying.
    PM (windows?) loads up OK, but when you try to open an existing or create new publication, you get the error "'cannot paste from clipboard.  Cannot read the available clipboard formats"?
    !. PM6.5 can only be operated on a contemporary OS, like Win98SE or Win2K.  Generally speaking, with later versions on Windows, it's a non-starter.  If this is the case, and it's essential you open your PM files, download and install the trial version of PM7.
    2. You probably have some corruption somewhere.  You can try trashing all the configuration files (search using the string  PM65*.cnf ) and re-loading PM65
    3. If suggestion 2 fails, you need to remove and re-install PM65, but even this may not work.  See 7.6 - Re-installing PageMaker of this linked PDF which was taken from the old AdobeForums FAQs.  (Note the date of this FAQs and begin to realise how ancient PM65 is.)
    4. Forget all the above, and move to InDesign.
    Iechyd da! John
    23:09 15/09/2009 BST

  • Forms 11gR2 - paste from clipboard into image item

    Hi, how can I paste image from clipboard straight into an Image item on Form?
    If it can't be done via standard Forms functionality, is there any workaround - I mean can Java Bean do it, or maybe drag and drop via Beans Area?
    I know it's quite odd functionality, but any hint is much appreciated.
    Thanks in advance. Jack

    Hello,
    <p>I think that it is not possible. The only ways to populate an Image Item is to use the Read_Image_File() or to query from the database.
    You can use a Java Bean that allows to drag and drop an image file.</p>
    Francois

  • Bug:  Copy / Paste from Clipboard.  Issue on HTML build.

    Bug: Copy Pasted from the clipboard.  On export to HTML, some of the graphic references got confused.  Replaced 4 image with the 3rd and 4th no where to be found.

    While there isn't a unique number displayed with each pasted item in the Assets panel, Muse does append a number to the image file name on export to maintain unique names on the exported site.
    As noted in my reply to your other thread, please export from scratch to an empty folder and verify the behavior. Thanks.

  • Object is distorted when pasted from clipboard into Acrobat

    I am running Acrobat X Pro. I can copy an image from my application and paste it Word without problem. However, if I paste it into Acrobat via Edit/Paste or using the Comment/Stamp tool to paste from the clipboard, the aspect ratio of the image is distorted. If I copy the image to Word, then copy it from Word and paste into Acrobat, it is not distorted. Is there any known problem with pasting metafiles from the clipboard into Acrobat? Any clues for diagnosing what might be the problem?

    A better approach might be to use Acrobat X Pro's Edit Object Tool to insert the image.
    Be well...

  • Paste from clipboard?

    I used the listener to get the javascript to copy in an object from InDesign using BridgeTalk. the problem is, I want to use the dimensions from the clipboard every time, not the dimensions recorded during the original "listen", anybody know how to change this?
    Thanks in advance!
    Heres the current script:
    var obj = app.activeDocument.selection;
    app.select(obj);
    app.copy(obj);
    //function pasteToPS() {
    var bt = new BridgeTalk;
    bt.target = "photoshop";
    var myScript = '//start\n';
    // insert stuff from PS listener below this line
    // =======================================================
    myScript += 'var id53 = charIDToTypeID( "Mk " );\n';
    myScript += ' var desc8 = new ActionDescriptor();\n';
    myScript += 'var id54 = charIDToTypeID( "Nw " );\n';
    myScript += 'var desc9 = new ActionDescriptor();\n';
    myScript += 'var id55 = charIDToTypeID( "Md " );\n';
    myScript += 'var id56 = charIDToTypeID( "RGBM" );\n';
    myScript += 'desc9.putClass( id55, id56 );\n';
    myScript += 'var id57 = charIDToTypeID( "Wdth" );\n';
    myScript += 'var id58 = charIDToTypeID( "#Rlt" );\n';
    //var from clipboard instead of the 122 value?
    myScript += 'desc9.putUnitDouble( id57, id58, 122.000000 );\n';
    myScript += 'var id59 = charIDToTypeID( "Hght" );\n';
    myScript += 'var id60 = charIDToTypeID( "#Rlt" );\n';
    //var from clipboard instead ofthe 119 value?
    myScript += 'desc9.putUnitDouble( id59, id60, 122.000000 );\n';
    myScript += 'var id61 = charIDToTypeID( "Rslt" );\n';
    myScript += 'var id62 = charIDToTypeID( "#Rsl" );\n';
    myScript += 'desc9.putUnitDouble( id61, id62, 72.000000 );\n';
    myScript += 'var id63 = stringIDToTypeID( "pixelScaleFactor" );\n';
    myScript += 'desc9.putDouble( id63, 1.000000 );\n';
    myScript += 'var id64 = charIDToTypeID( "Fl " );\n';
    myScript += 'var id65 = charIDToTypeID( "Fl " );\n';
    myScript += 'var id66 = charIDToTypeID( "Trns" );\n';
    myScript += 'desc9.putEnumerated( id64, id65, id66 );\n';
    myScript += 'var id67 = charIDToTypeID( "Dpth" );\n';
    myScript += 'desc9.putInteger( id67, 8 );\n';
    myScript += 'var id68 = stringIDToTypeID( "profile" );\n';
    myScript += 'desc9.putString( id68, "sRGB IEC61966-2.1" );\n';
    myScript += 'var id69 = charIDToTypeID( "Dcmn" );\n';
    myScript += 'desc8.putObject( id54, id69, desc9 );\n';
    myScript += 'executeAction( id53, desc8, DialogModes.NO );\n';
    // =======================================================
    myScript += 'var id70 = charIDToTypeID( "past" );\n';
    myScript += 'var desc10 = new ActionDescriptor();\n';
    myScript += 'var id71 = charIDToTypeID( "AntA" );\n';
    myScript += 'desc10.putBoolean( id71, true );\n';
    myScript += 'var id72 = charIDToTypeID( "As " );\n';
    myScript += 'var id73 = stringIDToTypeID( "smartObject" );\n';
    myScript += 'desc10.putClass( id72, id73 );\n';
    myScript += 'var id74 = charIDToTypeID( "FTcs" );\n';
    myScript += 'var id75 = charIDToTypeID( "QCSt" );\n';
    myScript += 'var id76 = charIDToTypeID( "Qcsa" );\n';
    myScript += 'desc10.putEnumerated( id74, id75, id76 );\n';
    myScript += 'var id77 = charIDToTypeID( "Ofst" );\n';
    myScript += 'var desc11 = new ActionDescriptor();\n';
    myScript += 'var id78 = charIDToTypeID( "Hrzn" );\n';
    myScript += 'var id79 = charIDToTypeID( "#Rlt" );\n';
    myScript += 'desc11.putUnitDouble( id78, id79, 0.000000 );\n';
    myScript += 'var id80 = charIDToTypeID( "Vrtc" );\n';
    myScript += 'var id81 = charIDToTypeID( "#Rlt" );\n';
    myScript += 'desc11.putUnitDouble( id80, id81, 0.000000 );\n';
    myScript += 'var id82 = charIDToTypeID( "Ofst" );\n';
    myScript += 'desc10.putObject( id77, id82, desc11 );\n';

    Hello Christoph,
    Fortunately, no. I have seen them do some very stupid things before, but this is what we have found to be the fastest way to create composites and create new scaled images for printers dpi regulations. I have seen many scripts that will scale and rotate the original placed link. Those scripts may work fine but they don't crop the images to the bleed size as copying from ID and pasting into PS would. This is important because sometimes we are dealing with 1 gig files, then scaling them up creates what is basically an unusable file. Is this something that could logically be scripted? Have you seen one like this?
    What we manually do now, which is what I would like to script is:     Select image(s) in ID, copy, in Photoshop make a new document, 300 dpi, CMYK, no color management. Then we would paste the clipboard data into this new Photoshop document as a smart object, with the top left corner 0 px, 0 px. Then we save it out using the original links name with an _xxx (xxx is the percent the link was placed in ID) added to the end of the name. We save them as flat tifs with LZW compression to a designated "Scaled Links" folder. Then, we place it in ID at 100%, at bleed.
    As you can see, this is a relatively simple task, but can be time consuming if you need to do it 50 times my 3:30 this afternoon! If you have any tips or suggestions, I would greatly appreciate it.
    Thanks,
    Danny

  • Can script or automator paste from clipboard in numbers? how?

    I have a large numbers template I use to determine pricingand create proposalsfor my business.  I use a licensed Excel spreadsheet to run simulations then copy and paste a block of information into our template.  I just finished my first script using AppleScript and managed to create a dock icon to open the template.  is there a way to select a cell and paste from the clipboard automatically?  Thanks in advance Apple community. 
    Ash

    Here's a way to have AppleScript to paste the contents of the clipboard starting at a designated cell (if the contents of the clipboard are tab-separated data with returns, then Numbers will expand the table as needed). You can place the handler (the to block) somewhere in your script and call it as shown, substituting the appropriate names for your document, sheet, table, cell.
    This, of course, assumes you have already succeeded in placing the contents you need onto the clipboard.
    SG
    -- call the handler with this:
    my pasteClipboard("Untitled.numbers", "Sheet 1", "Table 1", "A2")
    -- the handler:
    to pasteClipboard(targDoc, targSheet, targTable, targCell)
      -- select the Numbers cell
      tell application "Numbers" to tell document targDoc to tell sheet targSheet to tell table targTable to set selection range to cell targCell
      -- now paste contents of clipboard
      activate application "Numbers"
      delay 0.15 --gives user interface a chance to catch up--adjust as needed
      tell application "System Events" to keystroke "v" using command down
    end pasteClipboard

  • Why am I unable to copy and paste from clipboard?

    I am able to copy text from Safari on iPad 3, but it is not saving to clipboard because I am unable to paste it (no paste option comes up when I tap). Sometimes it also pastes a previously copied text from the clipboard instead. How can I fix this?

    but it is not saving to clipboard because I am unable to paste it (no paste option comes up when I tap).
    you would benefit from telling where you are when no paste option comes up with you tab because it's up to the app if they support paste at all

  • Images won't paste from clipboard to PS CS5 - is this a bug?

    Hi
    If I copy an image from a browser or anywhere on my machine, it won't paste into CS5.  Sometimes it does to start off with, but then it won't anymore.
    If I paste the image into MS Paint, it appears, but not in CS5.
    Anyone figured out a workaround for the glitch?
    I tried purging the clipboard, but it didn't fix the problem.
    Cheers
    Shaun

    Hi guys
    - No - the problem does not exist with PrntScr - I can paste in a whole screen, but not an copied image.  But can still paste a copied image into MS Paint.- is that a clue?
    - I will update the drivers
    - no Nik plugs
    Thanks guys
    Shaun

  • Changes in LV 8.6 with object placement while pasting from clipboard

    Hello all,
    I noticed a change in behaviour of LV 8.6. When I want to place an object (constant or terminal at block diagram or control at FP) from the clipboard in former versions i could make a click at a certain point and after Ctrl+C the object appeared at this very position. This is useful if you want to place a control in a specific FP- pane or inside a structure on BD. This doesn't work in 8.6 anymore and I find it very annoying to collect the object from the window's center. Is this a bug or didn't I find the appropriate checkbox in the Options- dialog? I understand that it makes it easier for novices, but this very useful feature of predetermined pasting is to much a pity to remove this feature.
    Greets, Dave
    Greets, Dave
    Solved!
    Go to Solution.

    Hi Ben,
    sorry I wasn't clear enough.I hope the pictures will make it more clearly.
    Here you see the selected Bool control which I copy to the clipboard.
    In some BD I click at the lower right corner and in former LV- versions the a boolean constant would appear at this point, but...
    ... in LV 8.6 it always appears centered. So I have to pick it up there and go back to the position I already have been.
    Greets, Dave
    Message Edited by daveTW on 04-22-2009 06:41 PM
    Greets, Dave
    Attachments:
    Image8.png ‏31 KB
    Image9.png ‏15 KB
    image 10.png ‏14 KB

  • Paste from clipboard loses background coloring

    I have a short piece of text on the system clipboard, to which I have applied various styling properties (font size, font family, font color, and background color).  I can see these fine when I view the clipboard contents, like this:
    However, when I do a paste, the background color gets lost (ALMOST all the time).  I have tried pasting into many of the text-handling apps I have (Word, Pages, Text Wrangler, TextEdit, etc., etc.).  In Word I have even tried Paste Special, which seems to say that it will use the formatting properties it finds.
    But, alas, none of these apps present the background coloring.  However, when I tried a paste into the Notes.app I did get the background color.  (Yeah!)
    Why are all these other apps losing the background color and (more importantly) is there a way to get paste in these other apps (esp. Pages or Word) to correctly render the background color from the clipboard?

    You're probably doing something wrong, because I can get this to work normally.
    Have you installed the filter in the document correctly? Have you looked [java tutorials for text components|http://java.sun.com/docs/books/tutorial/uiswing/components/generaltext.html]?
    Anyway, both your code and java tutorials one forgot to check 'str' for null at replace function. As describe in the API:
    API wrote:
    text - Text to insert, null indicates no text to insertTry posting a SSCCE that demonstrates your problem.
    Regards,

  • If I want to paste from clipboard on a Flex web app, which element and class should I use?

    I want to have this function: copy image from somewhere, and paste in an area in  Flex app, can I realize that?
    which element to support? canvas?
    which class can implement this?
    thanks!

    With System.setClipboard("Text this in clipBoard"); this we can use for Text, but I am not sure for setting Images in ClipBoard or no.
    You can refer this
    http://www.flexets.com/show-image-from-clipboard

  • List of found events changes sort order when pasted from clipboard

    when I find a set of events in iCal, the list appears in the window at the bottom of the page in the correct sort order when sorted by date, title or type. When I then copy that list to the clipboard and paste it into another program (Pages, MacJournal, TextEdit) the sort order changes.
    I work mostly in English, but my macbookpro keyboard is German, so I assume the problem is with the language settings. I've tried changing the system preferences for language and sort order, and that changes the sort order, but it doesn't get it right.
    Anyone have any ideas?
    Thanks

    when I find a set of events in iCal, the list appears in the window at the bottom of the page in the correct sort order when sorted by date, title or type. When I then copy that list to the clipboard and paste it into another program (Pages, MacJournal, TextEdit) the sort order changes.
    I work mostly in English, but my macbookpro keyboard is German, so I assume the problem is with the language settings. I've tried changing the system preferences for language and sort order, and that changes the sort order, but it doesn't get it right.
    Anyone have any ideas?
    Thanks

  • Pasting from clipboard

    When I copy anything - a web link, photo, words - and try to paste into an Outlook Web App email,  it crashes IE.  I have tried signing out and back in, rebooting, checking add-ons for compatibilty issues, removing recently added virus protection
    but nothing has helped.  IE crashes every time I try to copy/past into a message.

    Hi,
    First, we should narrow down where the issue is.
    Have you tried copying something using other browsers? and check if this issue still occurs.
    Also, Please run IE in No Add-on mode.
    From mailbox aspect, you can attempt to login OWA in
    light version to reduce the session in mailbox.
    Andy Altmann
    TechNet Community Support

  • Paste from clipboard does not include formatting although the option is set

    Hi,
    this worked for weeks and is part of my workflow (that's why I do not want to import the docx file). But inspite the option is set the formattings now are not included anymore.
    Happens since the update to 7.5.3 but I do not know this exactly. If I use ID6 it works but I need ID5.5 for some reason (plugin)!
    Ideas anybody for this strange behaviour?
    Thank you and regards
    Michael Steppes, Leipzig, Germany

    Not only - paragraph and character formats as well as local formatting.
    But the problem is solved thanks to Hans Haesler from the www.hilfdirselbst.ch-Forum:
    I moved the "Indesign Defaults"-file from the ID-standard folder thereby forcing ID5.5 to recreate it. And that's it: after that it works again.

Maybe you are looking for