I found this stackoverflow post mentioning the command xdg-open.
that's a bit convoluted to write, so i made an alias
alias lopen='xdg-open'
lopen foobar.pdf
lopen .
lopen somefile.py
All of it works flawlessly. :D I love it
PS. open command is taken by an openvt binary. Hence lopen.
Hint: To change the default association, in gnome at least:
Right-click->Properties->Open With->Set as default (lower right).
If you need to add a custom application. (I'll assume you created a .desktop icon and it shows up properly in your gnome menu using alacarte or by hand)
You need to update your:
~/.config/mimeapps.list
For example in my case, I added the following line:
text/plain=alacarte-made.desktop;
where alacarte-made.desktop is my sublime editor.
You can fine a list of most of the supported mimetypes in:
/usr/share/applications/defaults.list
No comments:
Post a Comment