0

With a desktop environment, there are file associations that goes with it.

I'm a minimalistic user, who doesn't use any of such, but still want some kind of file associations to ease my burden.

So I'm searching for a program that does something like the following.

open file.pdf

this will look at the extension, and translate to okular file.pdf.

Of course one can always write a bash script to do this. I wonder if there is something existing, so I don't reinvent the wheel.

3 Answers 3

1

You want xdg-open for this.​

1

You can use gnome-open for ubuntu / gnome.

1

You could also use zsh

# Suffix aliases (Type a file as a command and this program will launch)        
alias -s jpg=gthumb
alias -s png=gthumb
alias -s pdf=okular
alias -s html=firefox
alias -s ogg=mplayer

In your example you would just type file.pdf and okular would start

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .