AgenT
November 13th, 2006, 06:26 PM
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:
~/.local/share/applications/defaults.listIf so, open it, if not:
touch ~/.local/share/applications/defaults.listOpen ~/.local/share/applications/defaults.list and look for this entry:
[Default Applications]If it does not exist, add it on top. Next, add the following below "[Default Applications]":
text/plain=scribes.desktopYour completed entry should look like this:
[Default Applications]
text/plain=scribes.desktopNow run:
pkill nautilusIt 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:
/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:
grep gedit /usr/share/applications/defaults.list | sed s/gedit/scribes/g
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:
~/.local/share/applications/defaults.listIf so, open it, if not:
touch ~/.local/share/applications/defaults.listOpen ~/.local/share/applications/defaults.list and look for this entry:
[Default Applications]If it does not exist, add it on top. Next, add the following below "[Default Applications]":
text/plain=scribes.desktopYour completed entry should look like this:
[Default Applications]
text/plain=scribes.desktopNow run:
pkill nautilusIt 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:
/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:
grep gedit /usr/share/applications/defaults.list | sed s/gedit/scribes/g