Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to syncronize my clipboard with a remote machine using XQuartz and xsel. It works, but only after I run an X windows program:

connecting from Mac OS X with Quartz running and the pasteboard options selected:

ssh user@host -X
ls | xsel -b

(local clipboard is not affected)


(close xeyes)

ls | xcel -b

(now local system's clipboard works as you would expect)

it seems that starting any x program, like xeyes or gvim somehow completes the connection.

xsel has an option to specify display - would that affect thing?

I don't have startx or xinit installed (and I don't really want to install those) and this works fine after starting one of these x programs.

I also installed xsm to try and debug or figure out the display name, but running it just tells me:

sh: iceauth: not found
sh: twm: not found
sh: xterm: not found
smproxy: unable to connect to session manager

How can I do whatever xeyes or gvim does so that my X connection 'completes' and the keyboard starts working?

ps: My apologies as I know this is a rather specialized subset of linux knowledge, I've tried to do my best in asking the question though, and I have ordered a book on X.

share|improve this question
up vote 2 down vote accepted

Easiest is probably to run xset q or xdpyinfo, redirecting the output to /dev/null so that it doesn't puke on your display.


This will run a screensaver, then kill it (change the path and delay as needed):

/usr/libexec/mate-screensaver/popsquares & { sleep 0.01 ; kill $! ; }
share|improve this answer
thanks for your answer. installed both x11-utils and x11-session-utils so i could run those commands but didn't have any luck. running xeyes still does the trick though. – cwd Mar 29 '12 at 20:46
Hrm. I guess you need an application that opens a window and closes after a time. Not display... Oh! Maybe a screensaver. Let's see... – Ignacio Vazquez-Abrams Mar 29 '12 at 21:00
Ok, that's given me some good insight. Apparently it is a problem with XQuartz initializing and not with the remote system. If I switch to XQuartz / X11 and even open a new terminal the clipboard syncing from the remote system starts working. Very strange, thanks for your help. – cwd Mar 29 '12 at 22:25

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.