This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Dolphin opens .desktop files as text instead of launching

Tags: None
(comma "," separated)
User avatar
MirceaKitsune
Registered Member
Posts
330
Karma
0
OS
I'm experiencing an annoying problem: Whenever I click on a *.desktop file from Dolphin, the file is opened in the text editor KWrite instead of its application being launched. Needless to say the file is set as executable. I have no problem clicking on applications in the launcher which correctly starts them up. This seems to have started happening a few days or weeks ago, likely some sort of update issue.

I went to System Settings - Personalization - Applications - File Associations and searched for "desktop": The extension is indeed attributed to KWrite and other text editors. However the same is true on my laptop which does not have this issue! So it must be something else.

Image
User avatar
MirceaKitsune
Registered Member
Posts
330
Karma
0
OS
I tried the following recommended command but with no success:

Code: Select all
sudo update-mime-database /usr/share/mime


Also reinstalling the package shared-mime-info which was necessary after the above command broke it, this too with no results.
User avatar
Eric Adams
Registered Member
Posts
18
Karma
0
OS
I've never experienced this so just posting things I found. The Arch Wiki has a page on desktop files (https://wiki.archlinux.org/index.php/Desktop_entries). One thing in particular I found that you might want to try is the desktop-file-utils tools (desktop-file-edit, desktop-file-install, desktop-file-validate, update-desktop-database). Maybe the validate or update database options would help?
User avatar
MirceaKitsune
Registered Member
Posts
330
Karma
0
OS
Eric Adams wrote:I've never experienced this so just posting things I found. The Arch Wiki has a page on desktop files (https://wiki.archlinux.org/index.php/Desktop_entries). One thing in particular I found that you might want to try is the desktop-file-utils tools (desktop-file-edit, desktop-file-install, desktop-file-validate, update-desktop-database). Maybe the validate or update database options would help?


Thanks. The first command, when ran on a desktop file I used for testing, only issued a few warnings.

Code: Select all
mircea@linux-qz0r:~/Games/Quake/Xonotic_GIT> desktop-file-validate "./Run - Xonotic.desktop"
./Run - Xonotic.desktop: warning: value "" for key "Comment[en_US]" in group "Desktop Entry" looks redundant with value "" of key "GenericName[en_US]"
./Run - Xonotic.desktop: warning: value "" for key "Comment" in group "Desktop Entry" looks redundant with value "" of key "GenericName"
./Run - Xonotic.desktop: warning: key "TerminalOptions" in group "Desktop Entry" is deprecated


The one to update the database fails with an error instead, not sure if it's related to my problem:

Code: Select all
mircea@linux-qz0r:~/Games/Quake/Xonotic_GIT> update-desktop-database
Error in file "/usr/share/applications/org.kde.kfontview.desktop": "font/otf" is an invalid MIME type ("font" is an unregistered media type)
Error in file "/usr/share/applications/org.kde.kfontview.desktop": "font/ttf" is an invalid MIME type ("font" is an unregistered media type)
User avatar
mrgrimm
Registered Member
Posts
64
Karma
0
OS
there is a setting in one of the panels that when checked will give you the option of opening or executing a .desktop file. i'm looking for where it's at now. when i find it i'll post back. i noticed that plasma 5 has a bug in it. when you go into the setting page that has that and change anything that gets unchecked and from there forward you get a text popup every time you click a .desktop file. once you go back into that settings page and recheck that box whe next time you click on a .desktop file you will be presented with a popup asking you if you want to open or execute. choose execute and check the box that says don't ask again. i was running mint cinnamon and had added the plasma desktop and ran into the issue, and now i'm on kde neon and have run into this issue. if i don't find it maybe my post will jog someone else memory.


KDE Neon 64 Bit On Kernel 5.1, 430 nVidia Driver
Asus 970 Gaming/Aura, AMD FX 6300, 16Gig DDR3,
Samsung 120Gig 850 EVO, AOC 29" Ultra Wide 2560x1080, nVidia 750Ti,
USB 3 Card, Drives 2TB, 1.5TB, 1TB / 750Gig, 500Gig
User avatar
MirceaKitsune
Registered Member
Posts
330
Karma
0
OS
mrgrimm wrote:there is a setting in one of the panels that when checked will give you the option of opening or executing a .desktop file. i'm looking for where it's at now. when i find it i'll post back. i noticed that plasma 5 has a bug in it. when you go into the setting page that has that and change anything that gets unchecked and from there forward you get a text popup every time you click a .desktop file. once you go back into that settings page and recheck that box whe next time you click on a .desktop file you will be presented with a popup asking you if you want to open or execute. choose execute and check the box that says don't ask again. i was running mint cinnamon and had added the plasma desktop and ran into the issue, and now i'm on kde neon and have run into this issue. if i don't find it maybe my post will jog someone else memory.


That would make a lot of sense: If it's not the MIME type, such a setting would have to be the reason. I don't get any prompt myself, they're always opened as text files.

Perhaps that setting is located in ~/.config/dolphinrc? In a worst case scenario I can edit it manually... I didn't see an option in the settings panel of Dolphin.

In my case I'm running openSUSE Tumbleweed. It might be distro specific: Every machine with OS TW has this problem, including my laptop AFTER I updated it.
User avatar
mrgrimm
Registered Member
Posts
64
Karma
0
OS
i wouldn't be worrying about where it's buried in the file system. just see if you can find it going through the various settings panels.


KDE Neon 64 Bit On Kernel 5.1, 430 nVidia Driver
Asus 970 Gaming/Aura, AMD FX 6300, 16Gig DDR3,
Samsung 120Gig 850 EVO, AOC 29" Ultra Wide 2560x1080, nVidia 750Ti,
USB 3 Card, Drives 2TB, 1.5TB, 1TB / 750Gig, 500Gig
User avatar
mrgrimm
Registered Member
Posts
64
Karma
0
OS
ok i got it open dolphin, configure dolphin, general, confirmations, and check "executing scripts or desktop files" if not checked, apply and close. now if it works should be able to click a .desktop item and now get a popup, select execute, check don't show again, click ok.


KDE Neon 64 Bit On Kernel 5.1, 430 nVidia Driver
Asus 970 Gaming/Aura, AMD FX 6300, 16Gig DDR3,
Samsung 120Gig 850 EVO, AOC 29" Ultra Wide 2560x1080, nVidia 750Ti,
USB 3 Card, Drives 2TB, 1.5TB, 1TB / 750Gig, 500Gig
User avatar
MirceaKitsune
Registered Member
Posts
330
Karma
0
OS
mrgrimm wrote:ok i got it open dolphin, configure dolphin, general, confirmations, and check "executing scripts or desktop files" if not checked, apply and close. now if it works should be able to click a .desktop item and now get a popup, select execute, check don't show again, click ok.


Thank you! That solved the problem for me, it's working properly again.

I actually saw that setting when I first investigated. But since it was only for a confirmation, I didn't think it would have any use to my problem. I hope the design can be improved in the future as to not be so obscure.
jmunin
Registered Member
Posts
1
Karma
0
mrgrimm wrote:ok i got it open dolphin, configure dolphin, general, confirmations, and check "executing scripts or desktop files" if not checked, apply and close. now if it works should be able to click a .desktop item and now get a popup, select execute, check don't show again, click ok.


Hi,
I had the same problem as MirceaKitsune.
Your answer helped me a lot.
I have attached a screenshot to make it look like it arrived in Plasma 5.8, because it changed a bit. I had to choose the "Always ask" option and apply to fix it.
More details here.
Image

Best regards.


Bookmarks



Who is online

Registered users: abc72656, Bing [Bot], daret, Google [Bot], Sogou [Bot], Yahoo [Bot]