How to add a custom program to "Open With" list of programs in Xubuntu 13.04? How to associate a file with a program to open it with?
Solution 1
I found this way. And without any command line typing, which is good.
In "File Manager" right click on a file (e.g.
file.conf
) you want to be opened by Sublime Text 2 (or any other application).Choose "Properties". A window titled
file.conf - Properties
should appear.In its tab "General" click "Open With:" and then choose "Other Application...". A window titled
Open With
should appear.At the bottom of this window select "Use a custom command:" option and then "Browse...".
Browse to the necessary executable, Sublime Text 2, for example.
The most important part now: before click Ok
put the selected path into double quotes, e.g.:
"/opt/Sublime Text 2/sublime_text"
because otherwise it cannot accept the path .
Solution 2
Read this answer: How to associate file types with Wine in Nautilus.
You must create/edit a .desktop
file located in ~/.local/share/applications/
or /usr/share/applications/
Locate the Exec=
parameter and at the end of the line add %U
- it will be replaced with the filename to be opened.
Also see Associating file types in Ubuntu 13.10.
Solution 3
This is what I've just tried:
- Go to
/usr/share/applications
or~/.local/share/applications/
- Create a new file
appName.desktop
(appName
is the name of the app you want to use) - Copy content of any other *.desktop file (I used
gedit.desktop
) - Update the content:
Name =
,Exec =
, ..., with%U
being the filename to be opened. - Save it.
- Right click on the file you want to be opened with the
appName
- Go to Properties/Open With and click on 'Show Other applications' 8 Your appName should be there, just select it.
Solution 4
This answer worked for me: Globally associate file type with certain application
Download and install deb file for sublime text Eg: from https://www.sublimetext.com/3
After installation Check that file sublime_text.desktop exists in /usr/share/applications/
-
Fire terminal and type:
$ sudo gedit ~/.local/share/applications/mimeapps.list Add the following lines at the end: [Default Applications]
: (some existing association mappings)
[Added Associations]
: (some existing association mappings)
text/plain=sublime_text.desktop;
Save and Exit.
This file overrides the /etc/gnome/defaults.list, so all file association goes in to mimeapps.list file.
Related videos on Youtube
Garri Sumalapao Farol
Updated on September 18, 2022Comments
-
Garri Sumalapao Farol almost 2 years
How to associate file types with Sublime Text 2? have downloaded Sublime Text 2. I've unpacked it in
/opt/Sublime Text 2/
directory.Now I want to open all
.conf
files with ST2. But I can't set this easily. Xubuntu doesn't offer ST2 in the list ofOpen With
programs.I do:
right-click on the
fonts.conf
>>Properties...
>>Open With
>>Other Application
.And an
Open With
window appears. And it doesn't have ST2 application.How either to add ST2 to the
Open With
list or how to associate a file with ST2?UPD:
Similar questions and are not answered:
associate program to a file where program is not in list
How to associate file types with Sublime Text 2?
why are simple things getting hard in Ubuntu (Xubuntu)?
-
Admin almost 11 yearsVery similar question: askubuntu.com/questions/115113/…
-
Admin over 10 yearsGood article on adding programs to the "open with" list at [ubuntugenius.wordpress.com/2012/06/18/…
-
Admin over 10 yearsSee a better answer by IraGainesUK here
-
-
vishal almost 11 yearsI don't have the option user a custom command :(
-
James over 10 yearsYou can add %f to the end of the line instead of %U. Example: Exec=ProgramName %f
-
Waldir Leoncio over 8 years"Use a custom command" was removed some time ago, I believe before GNOME 3.0.
-
Keith Thompson about 8 yearsI suspect the quotes are needed only because there's a space in the path.
-
rektide almost 8 yearsIt's an answer to a different question. Each time you want to add sublime as owner of a file extension, you have to re-do this hacking. The proper answer is to add a /usr/share/applications/*.desktop file, such that whenever you want to open a file with Sublime, it'll be an option in the open file dialog.
-
user3653831 over 6 yearsStill not possible with ubuntu 17. Possible with ubuntu 7.
-
Vitor Abella about 5 yearsWorking on ubuntu 18.04