Journal simple question ...

Posté par  (site web personnel) .
Étiquettes : aucune
0
25
mar.
2004
est il possible par commande de transferer une chaine dans le tampon des copi/coli ?
et comment on le recupere ?

je voudrais une solution en script shell si possible, ou a default, en C ...

Merci
  • # Re: simple question ...

    Posté par  . Évalué à 2.

    Tu peux regarder le code de vi(m) (je suis pas sûr que vi le fasse), du coté de l'implémentation de "*y et de "*p .
    • [^] # Re: simple question ...

      Posté par  . Évalué à 1.

      Bon finalement je te copie/colle 2 morceaux de la doc de VIM :
      1) :help x11-selection
      10. X11 selection mechanism *x11-selection*

      If using X11, in either the GUI or an xterm with an X11-aware Vim, then Vim
      provides varied access to the X11 selection and clipboard. These are accessed
      by using the two selection registers "* and "+.

      X11 provides two basic types of global store, selections and cut-buffers,
      which differ in one important aspect: selections are "owned" by an
      application, and disappear when that application (e.g., Vim) exits, thus
      losing the data, whereas cut-buffers, are stored within the X-server itself
      and remain until written over or the X-server exits (e.g., upon logging out).

      The contents of selections are held by the originating application (e.g., upon
      a copy), and only passed on to another application when that other application
      asks for them (e.g., upon a paste).

      The contents of cut-buffers are immediately written to, and are then
      accessible directly from the X-server, without contacting the originating
      application.

      2) :help quoteplus
      *quoteplus* *quote+*
      There are three documented X selections: PRIMARY (which is expected to
      represent the current visual selection - as in Vim's Visual mode), SECONDARY
      (which is ill-defined) and CLIPBOARD (which is expected to be used for
      cut, copy and paste operations).

      Of these three, Vim uses PRIMARY when reading and writing the "* register
      (hence when the X11 selections are available, Vim sets a default value for
      |'clipboard'| of "autoselect"), and CLIPBOARD when reading and writing the "+
      register. Vim does not access the SECONDARY selection.

      Examples: (assuming the default option values)
      - Select an URL in Visual mode in Vim. Go to a text field in Netscape and
      click the middle mouse button. The selected text will be inserted
      (hopefully!).
      - Select some text in Netscape by dragging with the mouse. Go to Vim and
      press the middle mouse button: The selected text is inserted.
      - Select some text in Vim and do "+y. Go to Netscape, select some text in a
      textfield by dragging with the mouse. Now use the right mouse button and
      select "Paste" from the popup menu. The selected text is overwritten by the
      text from Vim.
      Note that the text in the "+ register remains available when making a Visual
      selection, which makes other text available in the "* register. That allows
      overwriting selected text.
  • # Re: simple question ...

    Posté par  . Évalué à 3.

    http://freshmeat.net/projects/xclip/(...)

    xclip is a command line utility that is designed to run on any system with an X11 implementation. It provides an interface to X selections ("the clipboard") from the command line. It can read data from standard in or a file and place it in an X selection for pasting into other X applications. xclip can also print an X selection to standard out, which can then be redirected to a file or another program.
  • # Re: simple question ...

    Posté par  . Évalué à 2.

  • # Re: simple question ...

    Posté par  . Évalué à 3.

    xclip ne te conviendrai pas ?

    voir la description:
    http://packages.debian.org/testing/x11/xclip(...)
    Ça doit surement exister pour d'autre distribution. Par contre, j'ai pas testé.
  • # Re: simple question ...

    Posté par  (site web personnel) . Évalué à 1.

    voila l oeuvre:

    http://doublehp.ath.cx/pluton_2004-03-25_02-09-03.png(...)

    dhp@pluton:~$ cat .scrot
    #!/bin/bash
    i=`/bin/date +%Y-%m-%d_%H-%M-%S`
    i=pluton_$i.png
    /usr/bin/scrot /var/www/$i
    /bin/echo "http://doublehp.ath.cx/$i(...)" | /usr/X11R6/bin/xclip # <= retirer le (...) cause bug de DLFP :/

    merci a tous.

    ( eh oui tout ca pour ca ... )

Suivre le flux des commentaires

Note : les commentaires appartiennent à celles et ceux qui les ont postés. Nous n’en sommes pas responsables.