You are not logged in.
Is there a way I can send the output of a command to the clipboard? For example, when putting together a package for the AUR, I want to get some md5sums. So I'll "md5sum [file] > md5" to later open it up in a text editor and copy it. I would much rather be able to just md5 file > clipboard and just paste it! Is this possible?
Last edited by synthead (2007-09-11 06:35:12)
Offline
I'd be interested in a way to achieve this as well.
For your particular problem: makepkg -g >> PKGBUILD is just fine. But remember to move those md5sums to the right place in the PKGBUILD.
Hail to the thief!
Offline
I'd be interested in a way to achieve this as well.
For your particular problem: makepkg -g >> PKGBUILD is just fine. But remember to move those md5sums to the right place in the PKGBUILD.
Location does not matter, and no order is defined for PKGBUILD fields. I personally prefer md5sums at the end. You rarely edit them manually -- and you always autogen them.
James
Offline
Is there a way I can send the output of a command to the clipboard? For example, when putting together a package for the AUR, I want to get some md5sums. So I'll "md5sum [file] > md5" to later open it up in a text editor and copy it. I would much rather be able to just md5 file > clipboard and just paste it! Is this possible?
Yes. You can do it very easily using 'xsel'. It is in community.
Example:
md5sum '/path/to/file/archbannerglass3.jpg' | xsel -i
places this:
91e843907f5d63e49617c4ae8cacf130 /path/to/file/archbannerglass3.jpg
on the X PRIMARY selection (PRIMARY is default). So, middle-clicking will then paste that wherever you like.
To switch to the SECONDARY selection or CLIPBOARD selection, use the -s or -b options, respectively. I'm not familiar with what SECONDARY does, to be honest, but placing the item on the CLIPBOARD selection allows for pasting via the right-click context menu or via CTRL+v.
Note:
When testing xsel's capabilities, you might want to clear the selections between each operation using -c in association with whatever selection option was used to capture the selection, e.g.:
xsel -c
#or
xsel -p -c
clears the PRIMARY selection, and
xsel -b -c
clears the CLIPBOARD selection.
You also might want to temporarily disable things like Glipper and Klipper during your testing just to be sure you don't get confused about whether a copy operation came from xsel or from Glipper or Klipper (i.e., the clear command, rightfully so, will not remove anything from Glipper or Klipper).
Finally, here's some nice background info on X selection operations:
http://www.jwz.org/doc/x-cut-and-paste.html
Last edited by MrWeatherbee (2007-09-06 13:32:06)
Offline
synthead wrote:Is there a way I can send the output of a command to the clipboard? For example, when putting together a package for the AUR, I want to get some md5sums. So I'll "md5sum [file] > md5" to later open it up in a text editor and copy it. I would much rather be able to just md5 file > clipboard and just paste it! Is this possible?
Yes. You can do it very easily using 'xsel'. It is in community.
Example:
md5sum '/path/to/file/archbannerglass3.jpg' | xsel -i
places this:
91e843907f5d63e49617c4ae8cacf130 /path/to/file/archbannerglass3.jpg
on the X PRIMARY selection (PRIMARY is default). So, middle-clicking will then paste that wherever you like.
To switch to the SECONDARY selection or CLIPBOARD selection, use the -s or -b options, respectively. I'm not familiar with what SECONDARY does, to be honest, but placing the item on the CLIPBOARD selection allows for pasting via the right-click context menu or via CTRL+v.
Note:
When testing xsel's capabilities, you might want to clear the selections between each operation using -c in association with whatever selection option was used to capture the selection, e.g.:xsel -c #or xsel -p -c
clears the PRIMARY selection, and
xsel -b -c
clears the CLIPBOARD selection.
You also might want to temporarily disable things like Glipper and Klipper during your testing just to be sure you don't get confused about whether a copy operation came from xsel or from Glipper or Klipper (i.e., the clear command, rightfully so, will not remove anything from Glipper or Klipper).
Finally, here's some nice background info on X selection operations:
Yes! That's exactly what I needed. Perfect! Takes care of everything else too.
Makes me a happier camper, thanks
Offline
Yes! That's exactly what I needed. Perfect! Takes care of everything else too.
Makes me a happier camper, thanks
Oh, hey ... just noticed you replied back.
Glad I could point you in the right direction. 'Xsel' is a pretty handy tool to have around IMO, though I haven't seen it mentioned much at all.
Offline