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.

1 Answer 1


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 $! ; }
  • 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, 2012 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... Mar 29, 2012 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, 2012 at 22:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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