My favorites | Sign in
Project Logo
                
New issue | Search
for
| Advanced search | Search tips
Issue 37: start from commandline
1 person starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  ----
Closed:  Oct 08
Priority-Medium
Type-Enhancement


Sign in to add a comment
 
Reported by bernd.worsch, Oct 08, 2009
Reasy is really usable and helpful. Is there a possibility to use it for
text available localy by starting (firefox with) it from the commandline.

Any ideas how to accomplish:

me> cat sometext.txt | reasy

reasy being some kind of shell/batch skript.
Comment 1 by bernd.worsch, Oct 08, 2009
Here is some quick spike to try opening some file in firefox and start reasying it by
selecting the text. This would nicely solve my problem, if reasy did start as
expected. But it doesnt. :(

BTW: I'd like a hotkey for "Select All and Start"
BTW: Maybe someone knows how to remote control firefox, to automate this hotkey from
the skript below?

reasy (Shell-Script)
--snip--
#!/bin/sh
# cat textcontent of file to firefox for reasy speedreader plugin
file=$1
textfile=${file}.reasy 
#todo: convert to latin1 textfile using recode
cp $file $textfile
firefox $textfile
rm -f $textfile
--snap--
Comment 2 by bernd.worsch, Oct 08, 2009
Consider this request done. The included shell-script is crude but useful. 

UseScenario is as follows:
- user wants to read some_local_file.txt
- user calls "reasy some_local_file.txt"
- file will be converted to txt and displayed in firefox
- if firefox happens to reside on another virtual desktop user switches there using
  the app entry in start-panel (works fine in ubuntu gnome desktop)
- selecting text starts reasy presentation

Best Regards
Bernd

--snip-reasy--
#!/bin/sh

# cat textfile to firefox reasy speedreader plugin

file=$1
reasyfile=${file}.reasy 

#get filetype
filetype=`file $file | egrep -i "utf-8|ascii|iso-8859" | cut -d ' ' -f2`
echo $filetype

#todo: convert whatever to txt

#establish tempfile 
## I mistakenly thought that we need to switch to html with paragraphs for reasy to work.
## That was wrong, it's just that html-tags will increase the counter used to check the 
## minimum words requirement to startup reasy.
## I'll keep the enscript/sed transforms, maybe they'll turn out to be useful sometime.

#enscript -whtml -p- $file | sed 's/^$/<p>/' > $reasyfile   # Variant A: html with p-tags
#enscript -whtml -p$reasyfile $file                         # Variant B: html
cp $file $reasyfile                                         # Variant C: plain text

#recode to latin1
if [ "$filetype" = UTF-8 ]; then
        recode u8..l1 $reasyfile
fi

#open file in firefox
firefox $reasyfile

# cleanup tempfile
rm -f $reasyfile
--snap-reasy--
Comment 3 by robbie.hinch, Oct 08, 2009
Thanks for this it's very clever, I will link to it from the project home page.
If you'd like a hot key for reading to start automatically, can I suggest that you
make the settings so that the reader pops up automatically, since it is then
triggered by a Ctrl-a press.
Status: Fixed
Labels: -Type-Defect
Sign in to add a comment

Hosted by Google Code