so I have script that begins with something very much like
#!/bin/bash
echo debug 1
var="$(xclip -o)"
echo debug 2
echo "$var"
#do something with var.
now 95% of the time it works just fine exiting in less than a second and actually doing something useful, but sometimes it hangs during xclip (hours or days If i do not notice and kill it sooner). Now I do not think the problem is with xclip ( I think it is probably a problem with the X server or window manager but so far I have not been able to track it down), but It would be nice if I could set a timeout for reading the clipboard so I could add error handling to the script.
so I have script that begins with something very much like
now 95% of the time it works just fine exiting in less than a second and actually doing something useful, but sometimes it hangs during xclip (hours or days If i do not notice and kill it sooner). Now I do not think the problem is with xclip ( I think it is probably a problem with the X server or window manager but so far I have not been able to track it down), but It would be nice if I could set a timeout for reading the clipboard so I could add error handling to the script.