maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   General (https://talk.maemo.org/forumdisplay.php?f=7)
-   -   Can I open a specific file through Personal Menu? (https://talk.maemo.org/showthread.php?t=29089)

cmdowns 2009-05-21 04:30

Can I open a specific file through Personal Menu?
 
Does anyone know if / how I can rig my Personal Menu to open a specific PDF file? I'm reading a copy of Peter Watts Blindsight (which is awesome, btw) in PDF format, and I'd like to be able to open it directly through Personal Menu, without having to open the PDF Reader first, then select the specific file.

Thanks in advance for your consideration.

qwerty12 2009-05-21 06:44

Re: Can I open a specific file through Personal Menu?
 
Name: <Dunno :) >
Command to execute: run-standalone.sh dbus-send --print-reply --dest=com.nokia.osso_pdfviewer /com/nokia/osso_pdfviewer com.nokia.osso_pdfviewer.mime_open string:'file://<path to pdf>'
DBUS Service Name: <Blank>
Run in teminal: <Unchecked>
Run as root: <Unchecked>

cmdowns 2009-05-21 19:45

Re: Can I open a specific file through Personal Menu?
 
Thanks for the reply. I've tried the command you suggested, but I can't seem to get it to work. I'm guessing the problem is my syntax. I've entered

Code:

run-standalone.sh dbus-send --print-reply -dest=com.nokia.osso_pdfviewer /com/nokia/osso_pdfviewer com.nokia.osso_pdfviewer.mime_open string:'file://</media/mmc2/tmp/'Peter Watts - Blindsight.pdf'>'
I've mucked up the <path to file>, haven't I? Can you please tell me what my mistake is and how to fix it?

Thanks again.

qwerty12 2009-05-21 20:08

Re: Can I open a specific file through Personal Menu?
 
Quote:

run-standalone.sh dbus-send --print-reply --dest=com.nokia.osso_pdfviewer /com/nokia/osso_pdfviewer com.nokia.osso_pdfviewer.mime_open string:'file:///media/mmc2/tmp/Peter Watts - Blindsight.pdf'
^ should work :)

It's --dest - not -dest
The '<'s and the '>'s were placeholders - sorry for not making that clear
The path requires the '/' as a *nix path usually has, the '//'s are part of the 'file:' (like http etc)

cmdowns 2009-05-21 22:35

Re: Can I open a specific file through Personal Menu?
 
Perfect! Thanks again!

Big Phat Jan 2009-12-17 15:22

Re: Can I open a specific file through Personal Menu?
 
For the N900 I couldn't find an easy way of opening a pdf stored on the ext3 partition. This solution worked brilliantly!

In case it's useful for anyone I've wrapped it up in a very rudimentary shell script below. If there's an easier way of doing this then someone please shout! It's annoying that osso_pdfviewer [filename(s)...] doesn't work, but there we go.

Here's the script (I've saved as /usr/bin/openpdf and then use openpdf [filename(s)...] from the command line):

Code:

#!/bin/sh

if [ `expr match "$1" "/*"` -eq 1 ]
 then
  fullpath=$1
 else
  fullpath="$PWD/$1"
fi

openme="file://$fullpath"

if [ -r $fullpath ]
 then
  run-standalone.sh dbus-send --print-reply \
  --dest=com.nokia.osso_pdfviewer /com/nokia/osso_pdfviewer \
  com.nokia.osso_pdfviewer.mime_open string:$openme
 else
  echo "could not read file $fullpath"
fi


Scharel 2010-03-16 08:10

Re: Can I open a specific file through Personal Menu?
 
Nice, but it doesn't work for me with Desctop Command Execution Widget.

Scharel 2010-03-16 08:14

Re: Can I open a specific file through Personal Menu?
 
Ok, it works.now, just had a whitespace in the path


All times are GMT. The time now is 04:16.

vBulletin® Version 3.8.8