>>>>> "rm" == Robert Morelli <morelli@cs.utah.edu> writes:
rm> Is there an easy way to get access to the XWindow clipboard from
rm> scsh or scheme 48? Specifically, I'd like to obtain the current
rm> selection as a string.
you could use the external utilities xclip and xprop. The former
provides access to the primary selection, the secondary selection and
the clipboard. The latter (assuming that you are running
ICCM-compliant applications, such as an xterm) provides access to the
various cut buffers. In particular, CUT_BUFFER0 is what many users
think of as the contents of the clipboard (in most applications, the
stuff that is pasted when you click on the middle button of your
mouse).
,----
| > (run/strings (/usr/X11R6/bin/xclip -o selection clipboard))
| '("Welcome to scsh 0.6.2 (Gambit-C 4.0)")
| > (run/strings (/usr/X11R6/bin/xprop -root -f CUT_BUFFER0 8s "\\n$0\\n"
CUT_BUFFER0))
| '("CUT_BUFFER0(STRING)" "\"Welcome to scsh 0.6.2 (Gambit-C 4.0)\"")
| >
`----
--
Eric Marsden <URL:http://www.laas.fr/~emarsden/>
|