20221122002707-eww_is_the_opposite_of_eww.md (2481B)
1 title: EWW Is Not Eww (also, info books are great) 2 date: 2022-11-21 00:00 3 author: Yuval Langer 4 tags: clipboard-speaker, emacs, eww 5 --- 6 7 So I find it hard to read. Yes, some people are like that, but I have 8 developed a technique to aid me on my readings: (Only for English, not 9 for my Mother Tongue Hebrew, but that's another topic). 10 11 It is all based on a little Python script I wrote called [Clipboard 12 Speaker][1]. 13 14 I mark a bunch of text, copy the text, and press a keybinding which 15 starts the script. The script then reads the contents of the clipboad, 16 then gives them to a text-to-speech engine that reads it. There are 17 some additional minor complexities, but that is the main workflow. 18 19 Now let me expand on that. 20 21 The three keybindings I have set are, again, defined through the Gnome 22 configuration UI: 23 24 - super-c - Takes the regular clipboard which is filled by usually 25 pressing C-c. 26 - super-x - Takes the weird clipboard which is normally filled just by 27 marking text. 28 - super-z - Stops the text-to-speech engine. 29 30 Normally you would like to mark a bunch of text and press super-x, 31 without first pressing C-c and then super-c, but sometimes that does 32 not work. I do not know why, as in the case with Firefox. 33 34 As an aside, Firefox has a Reader Mode which also has built-in 35 text-to-speech functionality. It is admirable and I love that Mozilla 36 chose to implement it, but I find it limited - one cannot control 37 where each batch of text to-be-read starts and where it 38 finishes. Usually whole paragraphs are chosen. Sometimes one wants to 39 sit back while the text is zoomed in, but the paragraph slides off the 40 viewport, so one cannot follow the text below a certain point. 41 42 Anyway, I want to read in Firefox, so I mark a bit of text, then press 43 C-c (text copied to clipboard) s-c (script takes clipboard contents, 44 starts the TTS engine and passes the text). I mark text, C-c s-c, mark 45 text, C-c s-c. 46 47 Now, if I read something in eww, I have a cursor by default and I can 48 comfortably move the point to the start of bit of text I want to read, 49 press C-<SPC>, move point to the end of the bit of text, then press 50 s-x. Easy. 51 52 By the way, a fancy thing I have added to the script's functionality, 53 is that the text-to-speech engine keeps receiving new text in its 54 stdin every time I press s-x or s-c, so you can mark text, press s-x 55 or C-c s-c several times and each of those bits of text would be 56 played in order. 57 58 [1]: https://codeberg.org/yuvallangerontheroad/clipboard-speaker