Copy text from anywhere on the Linux desktop. Videos, graphics, PDFs, sites or apps that prohibit copying, anywhere text appears. #productivity #knowledge #x11 #ubuntu #fedoralinux
UPDATE! See below...
Install scrot xsel tesseract
Make a hotkey using your desktop's equivalent of gnome-control-center.
We use Ctrl+ALT+SHIFT+C to really drive it home that we're doing a graphical copy.
Paste the following line as the command to run. Or save it as a script and make it executable.
scrot -s - | tesseract -l eng - - | xsel -b
============= More tricks!
Copy text as image. Screenshot part of the desktop and put a picture on the clipboard with `xclip`.
scrot -s - | xclip -selection clipboard -t image/png -i
(Paste it into any image editor, web page, or app that accepts "graphical paste")
On Wayland, use wl-copy instead of xclip.
How it works. The - (data) and | (pipe) operators "pipe" the data from one program to the next.
Why scrot? The screengrab and other utilities have config files that, if changed, could cause problems with our scrips.
More corrections: Apparently, these things do work under #wayland
Linux Trips & Ticks, our public group / 479474899200543
Coming soon: Our new site, TickTalk.win