5

I prefer the gnome desktop to KDE - but I prefer the Kate text editor to gedit - but gedit is the default in gnome.

How do I set it so that the default application when I double-click a file is Kate?

5 Answers 5

7

Try this little tutorial. Or, if you want a simpler way, just right click on the file and choose to open with the application you want.

1
  • Thanks Alex - I now about the right click option, but sometimes I just mindlessly double click on the file and would prefer it to load in Kate
    – HorusKol
    Feb 17, 2010 at 22:20
2

I wanted to change my default editor to emacsclient (which opens a file in the current emacs session, running in server mode). The problem was, I didn't have an emacsclient.desktop file anywhere. It worked when I just adapted the /usr/share/applications/emacs23.desktop file and put it in ~/.local/share/applications/emacsclient.desktop

This was based on the description at http://dev.eclipse.org/newslists/news.eclipse.newcomer/msg12557.html

2

Thanks Alex this works for me on Ubuntu 16.04 LTS:

create a file ~/.local/share/applications/defaults.list with this content:

[Default Applications]
application/x-perl=kate.desktop
text/plain=kate.desktop
text/x-chdr=kate.desktop
text/x-csrc=kate.desktop
text/x-dtd=kate.desktop
text/x-java=kate.desktop
text/mathml=kate.desktop
text/x-python=kate.desktop
text/x-sql=kate.desktop 

Create missing kate.desktop with a copy:

sudo cp /usr/share/applications/gedit.desktop /usr/share/applications/kate.desktop

In the copied file, replace gedit with kate i.e. with vim :%s/gedit/kate

0

This may be useful. I use it to accomplish the same thing as the tutorial alex linked. Should work on Ubnutu Karmic to Lucid.

~/$ cat bin/upkateprefs
#!/bin/bash
#Changes all new/existing gedit editor preferences to kate

#change existing preferences
sed -i "s/gedit/kde4-kate/" ~/.local/share/applications/mimeapps.list

#add new file type preferences
cat /usr/share/applications/defaults.list|grep gedit|sed "s/gedit/kde4-kate/" >> ~/.local/share/applications/mimeapps.list

#remove duplicates
sort -u ~/.local/share/applications/mimeapps.list -o ~/.local/share/applications/mimeapps.list

It's not perfect in that it will bring in a duplicate mime type line if you have more than just gedit in your existing preferences line. It will also break the file format if you have more sections than just [Added Associations]. Perhaps a wizard will come along and come up with a better script.

0

I am in Ubuntu 20.04 and I needed to edit ~/.config/mimeapps.list so that text/plain=org.kde.kate.desktop was in the [Default Applications] block.

[Default Applications]
text/plain=org.kde.kate.desktop

You must log in to answer this question.

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