LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 08-16-2007, 05:46 AM   #1
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,673

Rep: Reputation: 55
How to open a .pdf file


Hi folks,

Ubuntu 7.04 lamp server amd64
Fluxbox desktop
Rox-filer - File Manager
xpdf


How to make the .pdf files on the "File Manager" started with mouse pointer clicking on their icons?

$ ls -al /home/satimis/.config/rox.sourceforge.net/MIME-types/
Code:
total 16
drwxr-xr-x 2 satimis satimis 4096 2007-08-16 18:23 .
drwxr-xr-x 4 satimis satimis 4096 2007-08-16 18:11 ..
-rwxr-xr-x 1 satimis satimis   22 2007-08-16 18:13 application_pdf
$ cat ~/application_pdf
Code:
#! /bin/sh
exec  "$@"

Tried changing
exec "$@"
as
exec "xpdf"

or as
exec xpdf

w/o result. xpdf started w/o the file evoked/displayed.


Pls help. TIA


B.R.
satimis
 
Old 08-16-2007, 01:23 PM   #2
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
You want something like 'exec xpdf "$@"' but rox has an interface for this - right-click foo.pdf, select "file 'foo.pdf'", select "Set Run Action..."

-- To clarify, rox is replacing the shell process with the application in question (the 'exec') and is passing all individually quoted arguments (such as select files) to the process ("$@") and you just need to declare which application will handle the filetype.

Last edited by slakmagik; 08-16-2007 at 01:26 PM. Reason: occurred to me to say what rox was wanting to do
 
Old 08-17-2007, 01:25 AM   #3
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,673

Original Poster
Rep: Reputation: 55
Quote:
Originally Posted by digiot View Post
You want something like 'exec xpdf "$@"' but rox has an interface for this - right-click foo.pdf, select "file 'foo.pdf'", select "Set Run Action..."

-- To clarify, rox is replacing the shell process with the application in question (the 'exec') and is passing all individually quoted arguments (such as select files) to the process ("$@") and you just need to declare which application will handle the filetype.
Hi digiot,


Tks for your advice.


Code:
xpdf "#@"
can do the job. "exec" can be left out.


I have no solution for .txt file. Only nano, editor, is running on this box

Neither
Code:
exec nano "$@"
nor
Code:
nano "$@"
can do the job. File can't be opened.


Any advice? TIA


satimis
 
Old 08-17-2007, 01:35 AM   #4
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
Yeah, you don't have to have exec, but it's more efficient. As far as text/command-line apps like nano, you'll need to tell rox to open them in a terminal emulator. I use mrxvt and vim which would be 'mrxvt -e vim "$@"', whereas if you used xterm and nano, it would be 'xterm -e nano "$@"'. If you use a different terminal emulator, check it's man page for it's exec argument - it should be '-e' but may be something else.
 
Old 08-17-2007, 01:46 AM   #5
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,673

Original Poster
Rep: Reputation: 55
Quote:
Originally Posted by digiot View Post
Yeah, you don't have to have exec, but it's more efficient. As far as text/command-line apps like nano, you'll need to tell rox to open them in a terminal emulator. I use mrxvt and vim which would be 'mrxvt -e vim "$@"', whereas if you used xterm and nano, it would be 'xterm -e nano "$@"'. If you use a different terminal emulator, check it's man page for it's exec argument - it should be '-e' but may be something else.
Thanks digiot,

I got it. nano runs on xterm, in my case.


satimis
 
Old 09-15-2007, 09:33 AM   #6
gauthamk
Member
 
Registered: Jun 2007
Location: Chennai-India
Posts: 39

Rep: Reputation: 15
use command evince and file name.

eg:

evince xyz
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Geting error loop QFike:getch: File not open QFile:atEnd: this file is not open badgerbox76 Linux - Newbie 6 01-07-2006 05:30 PM
Some .pdf file cannot open....:( kenshinji Linux - Software 12 12-06-2005 07:37 PM
trying to open a pdf file kotoko Linux - Newbie 6 12-06-2005 07:36 PM
Open Office/PDF Help ZingSter Linux - Software 1 01-10-2005 04:07 PM
Convert Open Office file to PDF file. liguorir Linux - Software 1 01-13-2004 12:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 10:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration