You are not logged in.

#1 2017-02-14 10:07:37

Voxol
Member
Registered: 2015-03-04
Posts: 27

[SOLVED] Mistakenly assigned .desktop files to be opened as text files

This happened some time ago and since it was only a minor inconvenience I didn't care to try and fix it until recently, so I don't remember "exactly" what I did.

I think it was because I just upgraded plasma, but at a certain point I was opening an application on the desktop and I was prompted with the choice to either run the application or to open it as a text file.
I checked "remember my choice", but made the wrong one by accident and now everytime I click on a desktop icon of an application it opens with Kate.
(I should note that if I right click and choose "open" from the drop menu it runs the application as it should)

Now, before coming here for help I tried to do my homework and solve it myself.

I understood that i only modified the setting for the .desktop files, so I tried going to the file associations settings, found the x-desktop file type (which is associated to .desktop and .kdelnk) and confronted with another machine I have running Arch.
I found the two to be pretty much identical, listing a few text editors on the "Application Preference Order" in the General tab, and "Embedded Advanced Text Editor (katepart)" and "Okular (okulartxt)" on the "Service Preference Order" in the Embedding tab.

So I thought to try and remove all the elements from both lists thinking I would get again a prompt asking me how I wanted to open this kind of files (I'm linking to the screenshot to avoid making this post too heavy)
Screenshot 1

And it somewhat worked as now when I try to run something i get this window
Screenshot 2

But now I don't know what to associate this file to, so this is where I came to an alt and resorted to asking for help here.

PS: I don't know if this is a newbie question but it sure felt like one to me, so sorry if I chose the wrong section ^.^;

EDIT: Ok, I just remembered exactly what i did to make plasma ask me what I wanted to do with the file: I changed the desktop layout from "Desktop" to "Folder view" and when opening something I was asked if the default action was be to open the file or run it

EDIT2: I realised this thread would be better in Application & Desktop Envirorment, so I reposted it there, don't answer to this one.

Last edited by Voxol (2017-02-16 09:45:16)

Offline

#2 2017-02-14 16:18:54

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,793

Re: [SOLVED] Mistakenly assigned .desktop files to be opened as text files

Voxol wrote:

PS: I don't know if this is a newbie question but it sure felt like one to me, so sorry if I chose the wrong section ^.^;

EDIT: Ok, I just remembered exactly what i did to make plasma ask me what I wanted to do with the file: I changed the desktop layout from "Desktop" to "Folder view" and when opening something I was asked if the default action was be to open the file or run it

EDIT2: I realised this thread would be better in Application & Desktop Envirorment, so I reposted it there, don't answer to this one.

My colleague dust binned your other thread as a cross post.  In the future, if you would like a moderator to move a thread for you, please use the 'report' link on the thread and drop us a note.  One of us are usually around so the response is generally quick.  Moving this thread to Application and Desktop Environments.

You will want to be looking into the xdg-mime command,  in particular, the default sub command.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#3 2017-02-14 19:19:24

Voxol
Member
Registered: 2015-03-04
Posts: 27

Re: [SOLVED] Mistakenly assigned .desktop files to be opened as text files

ewaller wrote:

My colleague dust binned your other thread as a cross post.  In the future, if you would like a moderator to move a thread for you, please use the 'report' link on the thread and drop us a note.  One of us are usually around so the response is generally quick.  Moving this thread to Application and Desktop Environments.

You will want to be looking into the xdg-mime command,  in particular, the default sub command.

Sorry about the double post, it won't happen again.

Anyway as I'm not familiar with the xdg-mime command, I'm trying to follow this page and from what I can get this is basically the command line version of the graphical tool I used earlier, in fact when I looked at the ~/.config/mimeapps.list file I found the changes I did via GUI.

I tried to run this

xdg-mime default .desktop application

but it did nothing

Then I run

xdg-mime query default application/x-desktop

and it gave me

org.kde.kate.desktop

I don't really know what that means, but it's the same when I run the command in my other machine, so it should be right?

Point is, if I got this correctly (and I don't think so, since both the wiki and the man page aren't the clearest), these tool let me choose which application to use in order to open which type of file, but I don't want to use an application to open these files, or if I do, I don't know which application I want them to be opened with.

In fact it seems the mime settings for these applications are the same on my other pc, where everything runs as it should, so it makes me think the problem lies elsewhere.

Offline

#4 2017-02-15 12:56:42

Lone_Wolf
Forum Moderator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,922

Re: [SOLVED] Mistakenly assigned .desktop files to be opened as text files

The change you confirmed seems to be exclusive for KDE .

On the embedded tab, you should have several settings above the Service Preference Order .

Compare those between the 2 systems.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#5 2017-02-16 08:14:27

Voxol
Member
Registered: 2015-03-04
Posts: 27

Re: [SOLVED] Mistakenly assigned .desktop files to be opened as text files

They are the same, as they both are set to "Use the settings for the 'application' group", which are (for both systems) "Show file in separate viewer"
application/xdesktop settings
appication settings

Offline

#6 2017-02-16 08:43:25

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: [SOLVED] Mistakenly assigned .desktop files to be opened as text files

You can just remove the lines from ~/.config/mimeapps.list via an editor. Close your preference manager(s) first to make sure that they don't overwrite your changes on exit.

<shameless plug>You could also use mimeo --clear application/x-desktop wink</shameless plug>.

Of course, KDE may have its own separate configuration file that supplements or overrride mimeapps.list (I don't know).


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#7 2017-02-16 09:34:27

Voxol
Member
Registered: 2015-03-04
Posts: 27

Re: [SOLVED] Mistakenly assigned .desktop files to be opened as text files

Xyne wrote:

You can just remove the lines from ~/.config/mimeapps.list via an editor. Close your preference manager(s) first to make sure that they don't overwrite your changes on exit.

Already did that, even if they were the changes I did want and remembered, anyway, it didn't do anything.

I even deleted the file altogether, but nothing; I don't think that file is part of the problem.

EDIT: Just to clarify, in that files there were some other changes I did via gui, none that explains the behaviour I'm having.

Last edited by Voxol (2017-02-16 09:41:16)

Offline

#8 2017-02-16 09:40:12

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,740

Re: [SOLVED] Mistakenly assigned .desktop files to be opened as text files

This isn't a mimeapps adjustment, it's a dolphin setting. See here for a plethora of ways to revert: https://forum.kde.org/viewtopic.php?f=224&t=129445

Offline

#9 2017-02-16 09:44:58

Voxol
Member
Registered: 2015-03-04
Posts: 27

Re: [SOLVED] Mistakenly assigned .desktop files to be opened as text files

V1del wrote:

This isn't a mimeapps adjustment, it's a dolphin setting. See here for a plethora of ways to revert: https://forum.kde.org/viewtopic.php?f=224&t=129445

This was it, thank you!

Just to have it here if anyone else is having the same problem, the file with this setting was

~/.config/kiorc

Just deleted the line and I was prompted again with the choice.

Offline

Board footer

Powered by FluxBB