Pete Zaitcev (zaitcev) wrote,
Pete Zaitcev


When I read an entry at Chizumatic, I thought that it would be nice to have a PDA with the dictionary, yet use it for lookups off a PC. If we generalize the problem, all we need is to share clipboard between two systems.

Here's how I do it. First, we write a scriptlet, called blitz:

# Use a file for trace / debugging. A pipe is too anonymous.
/bin/cat > "$blitzchunk"
# The xclip places itself into background by default, but does
# not daemonize correctly, so ssh hangs. Therefore, we background
# it by hand from shell.
# The option -quiet makes xclip to run in the foreground.
DISPLAY=:0.0 /usr/bin/xclip -quiet -selection clipboard "$blitzchunk" \
  >/dev/null 2>&1 </dev/null &

Then, if you have a clipboard which you want to share, run: xclip -o | ssh blitz (normally you'd have it off a menu in your GNOME, "Share Clipboard to...", perhas as another scriptlet).

The ssh with public key authentication does the job of an RPC method. Also, you need xclip on both systems.

I have to say, blitz is godsent, although I'm the god. I only wonder if I am reinventing a wheel here...

UPDATE 2014/09/13: I saw an entry by gholt about using xsel instead of xclip, so I updated blitz and blitz-to to use whatever is installed.

UPDATE 2014/12/12: The blitz2 supercedes blitz.

Tags: linux, x11
  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded