Re: Launch default application from file in command line.

2011-12-20 Thread Bill Marcum
In gmane.linux.debian.user, you wrote:
 Hello there,

 Is it possible to launch a default application with a file from the 
 command line, e.g. something like:

 ./myfile.pdf

 which would retrieve the default PDF viewer and launch it on myfile?

 For the moment, I have a bash script called with launch argument, 
 which analyzes the extension of argument and calls the program; e.g. 
 launch myfile.pdf spots pdf and calls evince myfile.pdf. The 
 problem is that it won't follow automatically if I decide to change my 
 default PDF viewer or in case I create a new file/program association 
 (unless I make the script read some configuration file somewhere, I 
 suppose).

 Any idea?

Yet another option is /usr/bin/see, part of the mime-support package.

You can also use mc, which has its own config file.

-- 
We've had 30 years of center-right to extreme-right governance and the
country has gotten steadily worse.  The triumph of politics is that at
least half the country blames the Democrats for this.


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/E1RcoQ8-0001al-Mz@lat.local



Launch default application from file in command line.

2011-12-05 Thread Paul Isambert

Hello there,

Is it possible to launch a default application with a file from the 
command line, e.g. something like:


./myfile.pdf

which would retrieve the default PDF viewer and launch it on myfile?

For the moment, I have a bash script called with launch argument, 
which analyzes the extension of argument and calls the program; e.g. 
launch myfile.pdf spots pdf and calls evince myfile.pdf. The 
problem is that it won't follow automatically if I decide to change my 
default PDF viewer or in case I create a new file/program association 
(unless I make the script read some configuration file somewhere, I 
suppose).


Any idea?

Best,
Paul


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org

Archive: http://lists.debian.org/4edcd982.4090...@free.fr



Re: Launch default application from file in command line.

2011-12-05 Thread Paul Isambert

Le 05/12/2011 15:51, afuentes a écrit :

$ gnome-open file.pdf
it the same that double clicking on file.pdf from gnome

I have an alias like thsi
alias go='gnome-open'

so i just have to type
$ go file.pdf


Wonderful, thank you!
Paul


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org

Archive: http://lists.debian.org/4edcdab1.8090...@free.fr



Re: Launch default application from file in command line.

2011-12-05 Thread Andreas Rönnquist
On 05/12/11 15:52, Paul Isambert wrote:
 Le 05/12/2011 15:51, afuentes a écrit :
 $ gnome-open file.pdf
 it the same that double clicking on file.pdf from gnome

 I have an alias like thsi
 alias go='gnome-open'

 so i just have to type
 $ go file.pdf
 
 Wonderful, thank you!

For a non-gnome-specific alternative, take a look at xdg-open.

/Andreas


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4edcdb47.9060...@gusnan.se



Re: Launch default application from file in command line.

2011-12-05 Thread afuentes
$ gnome-open file.pdf
it the same that double clicking on file.pdf from gnome

I have an alias like thsi
alias go='gnome-open'

so i just have to type
$ go file.pdf 

greets!
aL


On Mon, 2011-12-05 at 15:47 +0100, Paul Isambert wrote:
 Hello there,
 
 Is it possible to launch a default application with a file from the 
 command line, e.g. something like:
 
 ./myfile.pdf
 
 which would retrieve the default PDF viewer and launch it on myfile?
 
 For the moment, I have a bash script called with launch argument, 
 which analyzes the extension of argument and calls the program; e.g. 
 launch myfile.pdf spots pdf and calls evince myfile.pdf. The 
 problem is that it won't follow automatically if I decide to change my 
 default PDF viewer or in case I create a new file/program association 
 (unless I make the script read some configuration file somewhere, I 
 suppose).
 
 Any idea?
 
 Best,
 Paul
 
 




-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/1323096702.3335.24.ca...@qindelbox.int.qindel.com



Re: Launch default application from file in command line.

2011-12-05 Thread Raf Czlonka
On Mon, Dec 05, 2011 at 02:55:03PM GMT, Andreas Rönnquist wrote:
 For a non-gnome-specific alternative, take a look at xdg-open.

Or if you're using a shell which sucks less ;^) - ZSH[0].
You can simply use:

% alias -s pdf=mupdf,zathura,etc.

and then:

% file.pdf

[0] http://www.zsh.org/

Regards,
-- 
Raf


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20111205151739.ga1...@linuxstuff.pl



Re: Launch default application from file in command line.

2011-12-05 Thread Paul Isambert

Le 05/12/2011 15:55, Andreas Rönnquist a écrit :

For a non-gnome-specific alternative, take a look at xdg-open.


Better yet, thanks.

Le 05/12/2011 16:17, Raf Czlonka a écrit :

[0] http://www.zsh.org/


Being a Linux newbie, I'll stick to the default shell for the moment, 
although I'll probably consider alternatives later :)


Best,
Paul


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org

Archive: http://lists.debian.org/4edce278.9030...@free.fr