You are not logged in.

#1 2016-05-29 15:42:29

zierler-f
Member
Registered: 2016-05-15
Posts: 9

Gnome Commander Default Applications

My Gnome Commander keeps opening 'text/plain' files with Libre Office Writer, which is driving me crazy. I've been trying to edit files like '~/.local/share/applications/defaults.list' and '~/.local/share/applications/mimeapps.list' but without any success. Then I tried changing the default application using 'xdg-open', and even Nautilus, which works everywhere except for gnome-commander. Does anybody know, where the file, which gnome-commander uses is located? I don't really care if it is global, or just for my user, but I won't accept editing my scripts with LibreOffice.

Thanks in advance!

Offline

#2 2016-05-30 20:09:50

turboscholz
Member
Registered: 2016-05-30
Posts: 2
Website

Re: Gnome Commander Default Applications

I assume that you want to change the default application to Emacs, right? wink So, lets get started: In '~/.local/share/applications/defaults.list' create an entry for 'text/plain' files in the [Default Applications] section:

[Default Applications]
text/plain=emacs-usercreated.desktop

Now, create the file '~/.local/share/applications/emacs-usercreated.desktop':

[Desktop Entry]
Encoding=UTF-8
Name=display
MimeType=text/plain;
Exec='/usr/bin/emacs'
Type=Application
Terminal=false
NoDisplay=true

Restart Gcmd and it should open all text/plain files with Emacs. See here for more information.

I'll try to fix this behavior in the future to be more consistent with other Gnome applications.

Offline

#3 2016-05-30 20:23:10

zierler-f
Member
Registered: 2016-05-15
Posts: 9

Re: Gnome Commander Default Applications

Thanks! I'll try it tomorrow and get back to you! However, isnt there an easier way than creating a user desktop file for every application I want to set as default?

Offline

#4 2016-05-30 20:48:04

turboscholz
Member
Registered: 2016-05-30
Posts: 2
Website

Re: Gnome Commander Default Applications

If you just want to open a text file with an editor of your choice, go to "Settings->Options->Programs" and set the 'editor' to whatever you want. Than you can open the file with that editor by typing 'F4' while the cursor is located on that file. If you prefer to use the mouse there is currently no other option than creating a desktop file.

Offline

#5 2016-05-30 20:49:12

zierler-f
Member
Registered: 2016-05-15
Posts: 9

Re: Gnome Commander Default Applications

Thanks!

Offline

#6 2016-05-31 02:57:07

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,433

Re: Gnome Commander Default Applications

I think you can define emacs in terminal options (see below pic) with something like

xfce4-terminal -e emacs %s

image of gnome-commander settings

Note: I don't use gnome-commander so I may be wrong.

Offline

#7 2016-05-31 05:03:19

zierler-f
Member
Registered: 2016-05-15
Posts: 9

Re: Gnome Commander Default Applications

Docbroke wrote:

I think you can define emacs in terminal options (see below pic) with something like

xfce4-terminal -e emacs %s

image of gnome-commander settings

Note: I don't use gnome-commander so I may be wrong.

I tried this but unfortunately it didnt work hmm

Last edited by zierler-f (2016-05-31 05:03:59)

Offline

#8 2016-05-31 08:48:48

zierler-f
Member
Registered: 2016-05-15
Posts: 9

Re: Gnome Commander Default Applications

turboscholz wrote:

I assume that you want to change the default application to Emacs, right? wink So, lets get started: In '~/.local/share/applications/defaults.list' create an entry for 'text/plain' files in the [Default Applications] section:

[Default Applications]
text/plain=emacs-usercreated.desktop

Now, create the file '~/.local/share/applications/emacs-usercreated.desktop':

[Desktop Entry]
Encoding=UTF-8
Name=display
MimeType=text/plain;
Exec='/usr/bin/emacs'
Type=Application
Terminal=false
NoDisplay=true

Restart Gcmd and it should open all text/plain files with Emacs. See here for more information.

I'll try to fix this behavior in the future to be more consistent with other Gnome applications.

Thank your very much! This worked great for me!

Offline

Board footer

Powered by FluxBB