-
Notifications
You must be signed in to change notification settings - Fork 231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Enhancement] – Please, allow the selected text in the PDF to be read with the normal xclip App. #200
Comments
I'm not very familiar with xclip. How is that different from using clipboard? |
Hello Ahrm, I don’t know clipboard and I couldn't find the program under Linux, but with xclip if you run the program in a terminal, the text that is currently selected under any QT or GNOME Window APP goes or is written directly to a file if you use the above command, and that is what I use in my Python program to make Text to Speech in any PDF Reader. I don’t have experience with the QT lib but there should be same method or API in QT where um can pass the selected text, from your GUI in a similar way to if it was a selected text inside a QT component Label or Edit Text component. Thank you, The very best regards, |
I am still a little confused. Isn't that the same as pressing |
The objective is the same to pass the selected text to a file automatically and then to drive the program text to speech but it must work with the normal X11-window manager of GNOME and QT or other under linux, I don't know about QT but I think that your Widget class that I think hinerantes from QTWidget class Must implement something similar to a QLabel like this:
line 812 from the file https://github.com/openwebos/qt/blob/master/src/gui/widgets/qlabel.cpp Thank you, |
What I think is happenning is that QTWidget doesn't know you have selected some text with the mouse and the X11 that is underneath doesn't know you have a text selected and so xclips can't get the text. But you are wright it should work like a selection before a Ctrl + C, but one that communicates the selected text to QTWidget and it will communicate to X11 where xclips will get the text. I think QTextCursor class is the key, but I don't know QT. Thank you, |
I seached a little bit and I think you can solve the problem by using this command instead:
instead of
I will still look to see if I can set the normal |
Should be fixed in 561e8d9. I haven't tested it though, because I am on windows and this seems to be a linux-specific thing. |
Okay I tested it on linux and it seems to be working. I issued a build command for the other repository, a new build should be available in about 20 minutes if there are no errors. |
Thank you very much, I will test it when the build is ready and give you my feedback. |
Hello Ahrm, I tested it on Linux Ubuntu 20.04 and it’s working 100%. Ahrm, you are one of the fastest developers I have ever seen. Congratulations. Thank you very much, The very best regards, |
Thank you. By the way, in that build there is a super experimental new feature which you might interesting. I have explained it in detail here: You need a beefy GPU to run it though (unless you use the heuristic mode which doesn't require running the server at all). |
Thank you Ahrm, I downloaded the script, In terms of final result, I tested on a book of electronics and I think your language model isn’t the best and I currently prefer the simple Visual one line with toogle_custom_color with my dyslexic mode colors settings. Currently I tested with 3 dyslexic persons and all are of the opinion that Sioyek is a really, really good for dyslexic people, really the best, currently those 3 persons have Sioyek installed by me on there computer. Linux and Windows. I tested also the three simultaneous modes with fast_read, custom color and visual one line, and it all worked well. Then I took the language model server down, and activated the the fast_read mode again to activate the heuristic mode and it worked well for the at least the pages of the book that I tried, it worker better then the language model. One could more easily read it then the transformer model, one. Which indicates that possibly the specific language model isn’t the best for general texts on electronics. But this is just my humble opinion, and not very knowledgeable in text models for Neural Networks with Transforms. All tested on Linux Ubuntu 20.04 LTS. Thank you Ahrm, Like I said, you are doing a fantastic work! The very best regards, |
Thanks you for the feedback! |
Hello Ahrm,
What I’m asking with this enhancement is simple I have one application that I made that in every previous PDF reader that I used on Linux Ubuntu 20.04 I selected a section text then I made a Key combination and my external program would run and use xclip to extract to a file the X11 system selected text from the PDF Reader and write to a txt file. Then my Python program would read that file (in the default RAM disk /dev/shm/ ) and send it to google to text-to-speach in EN or to translate from EN to PT or in PT or Spanish, German or other language. I use this when I’m late at night and I’m to tired to read, but I need to read, or to help my daughter read and understand long text’s in other languages.
The key application is xclips, and it use normal system selected text, so there should be some way to tell QT when you select a segment of text that the text is a string in Sioyek code.
Just if you are curious, my program that does text to speech or text translate and to speech is here:
Linux Translation and Text to Speech with natural voice
https://github.com/joaocarvalhoopen/Linux_Translation_and_Text_to_Speech_with_natural_voice
Thank you,
The very best regards,
João
The text was updated successfully, but these errors were encountered: