Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question

3 Answers 3

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.

share|improve this answer
    
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 at 15:24

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.

share|improve this answer
    
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

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.

share|improve this answer
    
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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.