Open a .txt file with default application in Linux

General questions regarding the usage of CodeLite
tataDan
CodeLite Curious
Posts: 5
Joined: Wed Sep 16, 2020 7:46 pm
Genuine User: Yes
IDE Question: C++
Contact:

Open a .txt file with default application in Linux

Post 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
DavidGH
CodeLite Plugin
Posts: 819
Joined: Wed Sep 03, 2008 7:26 pm
Contact:

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

Post 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
tataDan
CodeLite Curious
Posts: 5
Joined: Wed Sep 16, 2020 7:46 pm
Genuine User: Yes
IDE Question: C++
Contact:

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

Post by tataDan »

The answer to my question can be found here: https://github.com/eranif/codelite/issues/2577
tataDan
CodeLite Curious
Posts: 5
Joined: Wed Sep 16, 2020 7:46 pm
Genuine User: Yes
IDE Question: C++
Contact:

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

Post 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
Post Reply