*

Welcome, Guest. Please login or register.

Get your own OLPC - Buy an XO laptop on eBay!
Pages: [1]
Print
Author Topic: Use internal PDF reader at command line? (or through MC ??)  (Read 8979 times)

Use internal PDF reader at command line? (or through MC ??)

ylsf
Contributor
*
Posts: 50


February 02, 2008, 10:04:15 PM

I am  using MC (master commander) as a front-end for Mplayer to open videos, mp3s,etc.

How do I set it up to open PDF files via the internal reader?  I was trying to look for what command is being run for the reader activity but I can't seem to find it.......

I don't really like Journal for browsing though a drive....especially a large one.

Also, how do I get MC to open right to my "media" folder (to see my mounted drives)...

Logged

#1 Re: Use internal PDF reader at command line? (or through MC ??)

ylsf
Contributor
*
Posts: 50


February 07, 2008, 08:25:22 PM

anyone??
Logged

#2 Re: Use internal PDF reader at command line? (or through MC ??)

Grampa
Senior Contributor
**
Posts: 170


February 07, 2008, 09:38:04 PM

XO uses the Read activity for pdf. The Read icon doesn't appear on the Sugar menu, although you can easily install it by modifying the .info file. Even if you put the icon on the menu, however, you still can't open files from within Read -- it lacks a file/open command. It is probably easier to open pdf files with the built-in browser, which calls Read. You can use the browser to browse and open files on your drive by typing "file:///" in the address field. The browser will let you browse directories and open pdf files. I know this isn't what you are asking, but you may find it easier than using the Journal.
Logged

#3 Re: Use internal PDF reader at command line? (or through MC ??)

ylsf
Contributor
*
Posts: 50


February 09, 2008, 09:29:28 PM

Thanks for that..

I imagine there has to be a way still to "execute" the read command through MC.......Anyone else have an idea?
Logged

#4 Re: Use internal PDF reader at command line? (or through MC ??)

rwhe
Contributor
*
Posts: 35



WWW
February 09, 2008, 11:01:24 PM

You can do 'yum install evince', which installs a more capable, but still free, version of the Read activity. You can then use it to open a file at the command line like this:

$ evince myfile.pdf

[edit]

Although the Read activity is based on the same code as evince, evince can do some things that Read can't, such as flip a page at a time, even in ebook mode; read DjVu files; read comic book files (cbr and cbz), and lots more. I hope this functionality is eventually addeb back to the Read activity.

HTH,

Ron Hale-Evans
« Last Edit: February 09, 2008, 11:08:25 PM by rwhe » Logged

#5 Re: Use internal PDF reader at command line? (or through MC ??)

Ben James Ben
Senior Contributor
**
Posts: 142



February 10, 2008, 08:35:39 AM

Code:
#!/bin/bash
#
# readit
#
# Runs the Read Activity from the command line.  A specified URI
# is used.  The Read Activity is run in the background.
#
# Usage:
# readit [URI]
#
# Example:
# readit "file:///usr/share/activities/worldfactbook-maps/asia.pdf"
#
# This script is basically a shortcut for the following command:
# SUGAR_BUNDLE_PATH=/usr/share/activities/Read.activity sugar-activity readactivity.ReadActivity -b org.laptop.sugar.ReadActivity -a fakeactivityid -u [uri] &

SUGAR_BUNDLE_PATH=/usr/share/activities/Read.activity
_ACTIVITY=readactivity.ReadActivity
_BUNDLE=org.laptop.sugar.ReadActivity
_ACTIVITY_ID=fakeactivityid

sugar-activity ${_ACTIVITY} -b ${_BUNDLE} -a ${_ACTIVITY_ID} -u $@ &

Example of running the script:

$ chmod 755 readit
$ ./readit "file:///usr/share/activities/worldfactbook-maps/asia.pdf"

I'm not sure what problems, if any, using a fake activity id might cause with Sugar. I suspect that using the same id more than once at the same time might cause problems.
« Last Edit: February 10, 2008, 08:42:07 AM by Ben James Ben » Logged
Pages: [1]
Print
Jump to:  

Members
Total Members: 2406
Latest: sembik
Stats
Total Posts: 31943
Total Topics: 3843
Online Today: 25
Online Ever: 238
(April 18, 2011, 09:48:50 PM)
Users Online
Users: 0
Guests: 12
Total: 12