gazelle@shell.xmission.com (Kenny McCormack) writes:...
I have a shell script that needs to do something if certain text shows up
on the X clipboard. It currently uses "xsel" to access the clipboard, but >> needs to do polling in a loop, like this:\
I don't know for sure, but, for compiled code, have a look at:
man 3 XInternAtom
man 3 XGetWindowProperty
and PropertyNotify events
for the atoms 0(CUT_BUFFER0) and XA_PRIMARY.
In comp.windows.x, Winston <wbe@UBEBLOCK.psr.com.invalid> wrote:
gazelle@shell.xmission.com (Kenny McCormack) writes:...
I have a shell script that needs to do something if certain text shows up >>> on the X clipboard. It currently uses "xsel" to access the clipboard, but >>> needs to do polling in a loop, like this:\
I don't know for sure, but, for compiled code, have a look at:
man 3 XInternAtom
man 3 XGetWindowProperty
and PropertyNotify events
for the atoms 0(CUT_BUFFER0) and XA_PRIMARY.
The xev I have installed does not show PropertyNotify for those atoms. >Hacking xev to to catch them would be a good start to writing a C
program that monitors the clipboard.
I have a shell script that needs to do something if certain text
shows up on the X clipboard. It currently uses "xsel" to access the
clipboard, but needs to do polling in a loop, ...
I don't know for sure, but, for compiled code, have a look at:
man 3 XInternAtom
man 3 XGetWindowProperty
and PropertyNotify events
for the atoms 0(CUT_BUFFER0) and XA_PRIMARY.
The xev I have installed does not show PropertyNotify for those atoms.
Just tried something: Running "xev -root | fgrep Property" in an xterm,
then mouse selecting a word in any xterm window, reports a
PropertyNewValue event for CUT_BUFFER0.
However, no event was reported when the selection was lost, nor did
deletion in Emacs (which sets something typically used by "paste")
report an event, so this solution looks incomplete (it probably needs
to test XA_PRIMARY).
| Sysop: | Amessyroom |
|---|---|
| Location: | Fayetteville, NC |
| Users: | 59 |
| Nodes: | 6 (0 / 6) |
| Uptime: | 19:25:39 |
| Calls: | 810 |
| Calls today: | 1 |
| Files: | 1,287 |
| D/L today: |
10 files (21,017K bytes) |
| Messages: | 193,987 |