How-To Change Default Text Editor (or any other default program)
The following step-by-step guide will make the program Scribes open every plain text document instead of Gedit. Instead of Scribes, you may use any other program.
Check if this file exists:
Code:
~/.local/share/applications/defaults.list
If so, open it, if not:
Code:
touch ~/.local/share/applications/defaults.list
Open ~/.local/share/applications/defaults.list and look for this entry:
Code:
[Default Applications]
If it does not exist, add it on top. Next, add the following below "[Default Applications]":
Code:
text/plain=scribes.desktop
Your completed entry should look like this:
Code:
[Default Applications]
text/plain=scribes.desktop
Now run:
It is possible to set any mime type and any program that has a *.desktop entry. Find out your favorite program's desktop entry by looking in this folder:
Code:
/usr/share/applications/
You need to know what mime type you want to have your new program open. text/plain means opening up any normal text file. If you would like Scribes to open ANY text file, you would substitute text/plain with text/* and follow everything else.
Why is this better than just right-click on file -> Open With? Because with the above, ALL plain text files will be opened by Scribes, not just ones that have a particular extension.
For more details on what programs are used for what mime types, see file:
/usr/share/applications/defaults.list
One easy way to replace a program like gedit would be to get all entries containing gedit, replace them with scribes, and add that list to ~/.local/share/applications/defaults.list.
This quit one-liner does exactly that, except that it posts the results in terminal and you will just have to copy/paste it into your file:
Code:
grep gedit /usr/share/applications/defaults.list | sed s/gedit/scribes/g
Bookmarks