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?
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.
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.
Right click on a text file > Properties > Open With: > (whatever application you want)
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.
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.listis 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.listby deleting the current one and restoring the backup.