Author Topic: Justreader Command Line  (Read 1618 times)

patzoul

  • Newbie
  • *
  • Posts: 35
    • View Profile
    • http://
Justreader Command Line
« on: May 10, 2006, 07:38:30 am »
Do you know what is the syntax to open an html file with justreader using the command line?

I tried justreader x.html but I doesnt open the file. It just launches justereader and an error message pops up saying it couldnt open the file.

grog

  • Hero Member
  • *****
  • Posts: 692
    • View Profile
    • http://
Justreader Command Line
« Reply #1 on: May 10, 2006, 07:37:30 pm »
I can't install it to try out right now, but I'd suggest giving justreader the full path to the file, 'justreader /mnt/card/myfiles/myfile.html' for example. See if that works. hth
GROG!

patzoul

  • Newbie
  • *
  • Posts: 35
    • View Profile
    • http://
Justreader Command Line
« Reply #2 on: May 11, 2006, 09:03:27 am »
Didnt work. My objective is to find the command that work and set it in the ROX file manager to automatically open an html file.

karlto

  • Sr. Member
  • ****
  • Posts: 343
    • View Profile
    • http://
Justreader Command Line
« Reply #3 on: May 11, 2006, 04:11:23 pm »
Quote
Didnt work. My objective is to find the command that work and set it in the ROX file manager to automatically open an html file.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=126546\"][{POST_SNAPBACK}][/a][/div]
Most commands will give you some usage tips on the command line. Try:
Code: [Select]
justreader -hin a terminal to see if it will tell you...
SL6000-L, RC12

grog

  • Hero Member
  • *****
  • Posts: 692
    • View Profile
    • http://
Justreader Command Line
« Reply #4 on: May 11, 2006, 06:19:50 pm »
Quote
Most commands will give you some usage tips on the command line. Try:
Code: [Select]
justreader -hin a terminal to see if it will tell you...[div align=\"right\"][a href=\"index.php?act=findpost&pid=126604\"][{POST_SNAPBACK}][/a][/div]
That didn't work (for me anyway) & since I couldn't find any other way, AND to be one to never shrink form a challenge, I came up with this 'simple' script . Hope it works for you, patzoul. Just stick it somewhere in your path.

Code: [Select]
#!/bin/sh
# justreader.sh - enables opening a specified file from the command line
# 2006-05-11 GROG!

#set -x  # TESTING

# make sure justreader isn't already running.
ps | grep -E "\b[j]ustreader\b" | grep -v $$ && exit 0

if [ ! -s "$1" ]; then
    echo "Usage: ${0##*/} filename" >&2
    exit 1
fi

INFILE=$1
INDIR=${1%/*}

CONFFILE=~/Choices/common/JustReader.conf
TMPFILE=${CONFFILE%/*}/$$

trap "\rm -f $TMPFILE" 1 2 3 15

while read LINE; do
    set -- $LINE

    case $1 in
               File) echo "File = $INFILE";;
         Folderpath) echo "Folderpath = $INDIR";;
                  *) echo "$LINE";;
    esac

done < $CONFFILE > $TMPFILE

\mv -f $TMPFILE $CONFFILE

exec justreader

HTH
GROG!