Re: Back to copy/paste. (x11-users: to exclusive)
Re: Back to copy/paste. (x11-users: to exclusive)
- Subject: Re: Back to copy/paste. (x11-users: to exclusive)
- From: email@hidden
- Date: Wed, 16 Apr 2008 09:53:23 -0500 (CDT)
Hi,
On Tue, 15 Apr 2008, Jeremy Huddleston - email@hidden wrote:
What is pbpaste?
$ man pbpaste
pbcopy, pbpaste - provide copying and pasting to the pasteboard (the
Clipboard) from command line
Here is a little goodness that I use with other window managers when I
am running something like Xvnc:
$ cat bin/pbx
#!/bin/sh
# Paste-buffer to X selection
pbpaste | xsel -c
$ cat bin/xpb
#!/bin/sh
# X selection to Paste-buffer
xsel -p | pbcopy
With this I can go between the X selection and the Apple pasteboard if I
normally would not be able too, for example when using Xvnc. I just bind
those scripts to something in whatever wm I happen to be using. Here is an
example from my ~/.twmrc:
"" f.nop
"MacPB -> XSel" f.exec "exec pbx"
"XSel -> MacPB" f.exec "exec xpb"
"" f.nop
xsel is a little utility found on the internet, I don't know if it is in
macports or fink. I got my ancient version from here:
http://www.niksula.cs.hut.fi/~vherva/xsel/
I had to create this Makefile for it:
$ cat xsel-0.04.1/Makefile
# http://www.niksula.cs.hut.fi/~vherva/xsel/
all : xsel xsel.1.gz
xsel.c :
curl -O http://www.niksula.cs.hut.fi/~vherva/xsel/xsel.c
xsel.man :
curl -O http://www.niksula.cs.hut.fi/~vherva/xsel/xsel.man
xsel : xsel.c
gcc xsel.c -O2 -o xsel -L/usr/X11R6/lib -lX11 -lXt -lXaw -lXmu
xsel.1.gz : xsel.man
gzip -c --best xsel.man > xsel.1.gz
install : all
install -d -o0 -g0 /usr/local/bin
install -s -o0 -g0 xsel /usr/local/bin/xsel
install -d -o0 -g0 /usr/local/share/man/man1
install -o0 -g0 -m 0644 xsel.1.gz /usr/local/share/man/man1/xsel.1.gz
(You'll need to change the spaces in the begining of every line to tabs
for it to work.) Just make a directory, cd into it, create the above
Makefile in there, and run make and sudo make install from that dir.
Alternatively I see that there is a newer xsel available here:
http://www.vergenet.net/~conrad/software/xsel/
FWIW I have never really had any problems with copy/paste betteen X11 and
OSX, I guess I am just lucky. I think see the goodness because I run
xclipboard, that may be a useful workaround for now. When I run xclipboard
then I can even do the following which otherwise works oddly:
Highlight some text in xterm.
Do cmd-c.
Click somewhere else in xterm to make the selection disappear.
Even select some other text in xterm.
Go to Terminal.app and do cmd-c.
All the time I have what ever I expected when I did the cmd-c appear in
Terminal.app.
later,
mzs
_______________________________________________
Do not post admin requests to the list. They will be ignored.
X11-users mailing list (email@hidden)
This email sent to email@hidden