3 ms·
I would be quite happy with this, actually. I wouldn't even bother with the tld regex and just settle for "http" The part I'm missing is what to tail?
by forgotmypw17 5y ago
I would be quite happy with this, actually.
I wouldn't even bother with the tld regex and just settle for "http"
The part I'm missing is what to tail?
- tremon 5y agoThere is nothing to tail, because (FAFAIK) there are no clipboard events in Linux (well, in X). The best you can do is poll xclip every X ms, so you'd get: while sleep .2 ; do xclip -o ; done | uniq | grep -E 'https?:' but that is pretty wasteful of resources. Luckily processes are cheap on Linux :)
- forgotmypw17 5y agoThank you! I can't imagine myself clipping something more than once 5-10 seconds, so I can set the interval to that. I want to take this moment to remind you that the Web includes http, not just https, and ignoring it is a failure at accessibility and compatibility. For myself a week from now looking for this, here is the version which works for me: while true; do xclip -o | uniq | grep ^http > ~/url.txt ; sleep 5; done Thank you again, this will make my life much easier.
- pbhjpbhj 5y agoPlasma/KDE's Klipper clipboard app has Actions that will do this, fwiw. http://linux-blog.org/make-klipper-work-for-you/ http://linux-blog.org/make-klipper-work-for-you/. You could probably do it very simply by remapping ctrl+c depending on your DE.