# default application to open text file in Thunar under Awesome WM

I'm on Xubuntu 12.04 and using Awesome WM. In Awesome session, If I double click a plain text file(txt, asc, rb, py etc.) in Thunar, it opens with Abi Word. But I want it to open with a text editor not a word processor. In Xubuntu/Xfce session, it does open with text editor(Leafpad). How could I fix it without setting it for various text files?

-

Right click on a text file > Properties > Open With: > (whatever application you want)

or

Right click on a text file > Open With: > Open With Other Application... > (select and check "Use as default for this kind of file"

You use Awesome WM but I hope it is only a Thunar's affair, so the solution may be the above.

-
Thanks for your quick response, @MakisH. This works but I have to setting up for all types of text file which is unreasonable. Since it works as I expected in Xfce session, I guess there is something wrong that I'm not aware of. –  hrzhu Mar 25 '13 at 7:43

I haven't used Awesome WM and don't understand why you're seeing what you're seeing. To my mind, a window manager shouldn't cause changes to which application opens which file type (or file extension).

You also wrote (emphasis mine): "... If I double click a plain text file (txt, asc, rb, py, html etc.) in Thunar, it opens with AbiWord. But I want it to open with a text editor not a word processor. In Xubuntu/Xfce session, it does open with text editor (Leafpad). How could I fix it without setting it for various text files?"

To my mind, when most of us, irrespective of operating systems, double-click on an .html file, the file opens in our chosen browser and not in a text editor.

Anyway, one possibility is that your ~/.local/share/applications/mimeapps.list is corrupted. Make a backup of this file and then delete the existing one. Log out and log back in. The file you've deleted will be recreated and populated as you open files. If you wish, you can always revert to the previous mimeapps.list by deleting the current one and restoring the backup.

-
It's fine with html file, it opens in Firefox. But most other text files ain't. txt files should open with editor, py/rb file(w/o +x permission) should also open with editor. But they all open with Abi Word. The problem doesn't exist if I log into Xfce. I've had no luck with the mimeapps.list file, I move it to mimeapps.list.bak and then re-log, the problem remains and no new mimeapps.list appears. –  hrzhu Mar 25 '13 at 12:12

If you're using Xfce 4.10, then you can Settings > MIME Type Editor, then set text/plain to whatever text editor you want. I'm not sure if this will take care of all possible file extensions associated with plain text files, but my hunch is that it should help.

-
Thanks for your answer. In MIME Type Editor, I see text/x-python is set to open with text editor, but anyhow when I'm in awesome session it still opens with abiword. I don't remember how and when I mess this up. I don't have the same problem with my laptop running the same software. Anyway, I'll just bear with it. I'm a terminal guy so the problem doesn't bother me very often and I plan to reinstall Xubuntu when next LTS is released. –  hrzhu Jan 21 '14 at 15:24

On Ubuntu the default applications are set in /usr/share/applications/defaults.list (root access) and override by ~/.local/share/applications/mimeapps.list (user access).

I would suggest editing the second file unless you intend to make your change permanent on several sessions.

-