Page 1 of 1

Open a .txt file with default application in Linux

Posted: Wed Sep 16, 2020 8:05 pm
by tataDan
I am using CodeLite 13.0.0 in Debian Linux 10 (gnome).

When I right-click on a .txt file in a src folder in a project and choose "Open with Default Application", the file will be opened with LibreOffice Writer.

How do I make CodeLite open it with gnome gedit (or any other text editor) instead?

Thanks

Re: Open a .txt file with default application in Linux

Posted: Wed Sep 16, 2020 8:50 pm
by DavidGH
Hi,

The same thing happens here (a buster virtualbox guest using xfce). That's also what happens if its file manager opens a txt file. It's almost certainly because xfce and gnome think that a txt file needs to be opened in a word processor :? . In my 'real' buster with lxqt, CodeLite opens them in featherpad.

I don't know how to change that system setting in gnome, but google does.

Regards,

David

Re: Open a .txt file with default application in Linux

Posted: Mon Sep 21, 2020 2:58 am
by tataDan
The answer to my question can be found here: https://github.com/eranif/codelite/issues/2577

Re: Open a .txt file with default application in Linux

Posted: Wed Sep 23, 2020 10:51 pm
by tataDan
I believe that I have resolved the problem by adding a file named "defaults.list" to my $HOME/.local/share/applications directory. This file consists of the following lines:

Code: Select all

[Default Applications]
text/plain=org.gnome.gedit.desktop