LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Ubuntu (https://www.linuxquestions.org/questions/ubuntu-63/)
-   -   How to open a .pdf file (https://www.linuxquestions.org/questions/ubuntu-63/how-to-open-a-pdf-file-577501/)

satimis 08-16-2007 05:46 AM

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

slakmagik 08-16-2007 01:23 PM

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.

satimis 08-17-2007 01:25 AM

Quote:

Originally Posted by digiot (Post 2861132)
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

slakmagik 08-17-2007 01:35 AM

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.

satimis 08-17-2007 01:46 AM

Quote:

Originally Posted by digiot (Post 2861682)
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

gauthamk 09-15-2007 09:33 AM

use command evince and file name.

eg:

evince xyz


All times are GMT -5. The time now is 01:42 PM.