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.
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 Lucas . Évalué à 2.
[^] # Re: simple question ...
Posté par Lucas . Évalué à 1.
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 doublehp (site web personnel) . Évalué à 1.
au pire, je veux bien ecrire une app en C qui fera le taf, mais pas plus.
mais ca me dit pas comment le faire
je voudrais une solution en script shell si possible
[^] # Re: simple question ...
Posté par gnumdk (site web personnel) . Évalué à 1.
http://linuxfr.org/comments_reply,10888,378393,5.html(...)
[gnumdk@cassiope gnumdk]$
bon, je te vois venir que ca te vas toujours pas :D
[^] # Re: simple question ...
Posté par doublehp (site web personnel) . Évalué à 1.
object not accessible
dhp@pluton:~$ dcop klipper klipper setClipboardHistoryItem 1
object not accessible
[^] # Re: simple question ...
Posté par plagiats . Évalué à 1.
# Re: simple question ...
Posté par mnemosyne . Évalué à 3.
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 doublehp (site web personnel) . Évalué à 1.
je vois pas trop la diff entre les deux, mais ROXOR dtf
[^] # Re: simple question ...
Posté par Calim' Héros (site web personnel) . Évalué à 1.
# Re: simple question ...
Posté par manatane . Évalué à 2.
un exemple : http://ftp3.ie.freebsd.org/pub/FreeBSD/distfiles/xsel.c(...)
amuse toi bien :)
# Re: simple question ...
Posté par gnujsa . Évalué à 3.
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 doublehp (site web personnel) . Évalué à 1.
# Re: simple question ...
Posté par doublehp (site web personnel) . Évalué à 1.
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.