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

How do I unset default to open .desktop in a text editor?

Tags: None
(comma "," separated)
mfrandsen
Registered Member
Posts
2
Karma
0
While setting up KDE5 I did a stupid clickthrough for all the .desktop icons in /usr/share/applications.

When a dialogue asked what to do when I click on a .desktop icon I answered to open in a text editor (KWrite) and yes, don't ask me again.

So now any .desktop (except on the Desktop) will not execute the app but just bring up the .desktop file in an editor.

How do I unset this setting so that a click activates the app?

There is a similar question that is answered for Nautilus on Ubuntu, and a clear answer is given to reset the icon behavior:

http://askubuntu.com/questions/596274/f ... s-programs

However I can not find the equivalent reset method for KDE Dolphin.

Thanks!
Marv
User avatar
Rog131
Registered Member
Posts
828
Karma
10
Do not ask again

Image

The 'Do not ask again' is saved to the: ~/.config/kiorc

Image

The whole 'Executable scripts' part can be removed. Then the KDE will fall to the default.
Or change to 'behaviourOnLaunch=alwaysAsk'
Or Dolphin settings: Confirmations - Ask for confirmations in all KDE applications when:

Image
Dave-P
Registered Member
Posts
30
Karma
0
HI,
The 'Do not ask again' is saved to the: ~/.config/kiorc I used "Find" but no such file was found,
nor could I find it anywhere.

I noted the following, but there is no File entry in the luncher.
Click Files in the Launcher, select Edit > Preferences and then the Behavior tab:

Also noted the following, but permissions does not explain anything.
Help in Right-Click > Properties > Permissions explains this behavior:

Could someone please explain a step by step method to resolve this issue.
at 76 life is too short to spend half of it searching files, and poking about without knowing what I am doing.

Dave P..
mfrandsen
Registered Member
Posts
2
Karma
0
This is how I ended up solving the problem. Two ways actually.

1. Via user interface menu:

Open up a folder (in Dolphin). Main Menu -> Settings -> Configure Dolphin -> General -> Confirmations
Check YES to "Ask for confirmation when: Executing scripts or desktop files" and you will have a choice again to execute or edit a .desktop file as you wish.

2. Find That Obscure File & Change It

For me this was a file in the home directory: ~/.config/kiorc

I have a kiorc file but there is not very much in it. If it does not exist then exercise your awesome user powers to create a blank kiorc.

Open up or create that bad boy kiorc file in a text editor such as gedit or kwrite.

Under a line with [Executable scripts] the next line should be edited to be: behaviorOnLaunch=execute
and your .desktop file will execute rather than edit. That is how mine is now set.

i.e.

[Executable scripts]
behaviourOnLaunch=execute

If you want to be asked what you want to do then you have two options.
(1) If you erase the whole [Executable scripts] deal then supposedly you get the default behavior which is to be asked what you want to do.
Apparently that requires a kiorc file to exist so that the lack of [Executable scripts] can be noticed.

(2) You can also explicitly set the behavior to ask you what you want to do:

[Executable scripts]
behaviorOnLaunch=alwaysAsk

Good luck!
Dave-P
Registered Member
Posts
30
Karma
0
Thanks mfrandsen for the very informative reply.
Unfortunately I get the following results :-
In Dolphin Main Menu -> Settings -> Configure Dolphin -> General -> Confirmations
There are only 3 options -
1) Moving files or folders to trash
2) Deleting files or folders
3) Closing dolphin windows with multiple tabs.

I found the kiorc file home/.kde/share/config
[CODE]
[Confirmations]
ConfirmDelete=true
ConfirmTrash=true
[END]
I have tried deleting the last two lines and also deleting [Confirmations]
No difference, script opens in Kwrite.
I tried putting in --
[Executable scripts]
behaviourOnLaunch=execute
Still the same, opens in Kwrite
I tried renaming the file --
Still the same.
Dave P..
User avatar
Rog131
Registered Member
Posts
828
Karma
10
Dave-P wrote:Thanks mfrandsen for the very informative reply.
Unfortunately I get the following results :-
In Dolphin Main Menu -> Settings -> Configure Dolphin -> General -> Confirmations
There are only 3 options -
1) Moving files or folders to trash
2) Deleting files or folders
3) Closing dolphin windows with multiple tabs.



There are KDE4 applications and there are the KDE Frameworks 5 applications.

Dolphin with the KF5 is having the "Ask for confirmation when: Executing scripts or desktop files". The KDE4 doesn't have it. Also the KF5 is using the ~/.config/ directory for the configuration files. The KDE4 is saving all KDE setting etc. files to the ~/.kde4/ ( some distributions are using ~/.kde/ ).

Image
Full image: http://i.imgur.com/ZFuPGdW.png


'Get user's permission before executing scripts or desktop files' was added with the Git commit 6fe41269df673215b88b52571b574ed575d81e6f - Bug 275405 - Dolphin does not honor file association setting for scripts but executes them: https://bugs.kde.org/show_bug.cgi?id=275405


Dolphin version cli

KF5:
Code: Select all
$ dolphin -v
dolphin 16.04.0


KDE4 with the dolphinpart4:
Code: Select all
$ dolphin4 -v
Qt: 4.8.7
KDE Development Platform: 4.14.19
Dolphin: 14.12.3


If using pure KDE4 then the
Code: Select all
$ dolphin -v

will show the Dolphin version.
Dave-P
Registered Member
Posts
30
Karma
0
Qt: 4.8.7
KDE Development Platform: 4.14.18
Dolphin: 15.04.0
The kiorc fire is in a kde4 folder.
Looks like its only possible to change back to executing the script on a left click,
with an update to Dolphin, and Synaptic is no help as everything has been updated.
Yet a setting has been changed somewhere, it just seems impossible to find where.
Dave P..
Graham Perrin
Registered Member
Posts
16
Karma
0
Rog131 wrote:Image


In that screenshot:
Code: Select all
behaviourOnLaunch=open

– seems to be a bug with clean, updated installations of Kubuntu. In Ask Ubuntu, my answer to *.desktop files opening in Kate gives credit to mfrandsen for the solution in my case:
Code: Select all
behaviourOnLaunch=execute


Which of these two areas should I use for my bug report?


Either way, I should cross-reference KDE bug 363542 – When using the "Add network folder" shortcut in the network-menu it asks for confirmation to execute the script.
User avatar
Rog131
Registered Member
Posts
828
Karma
10
With the (holy trinity) :

KDE Frameworks 5.32.0
KDE Plasma 5.9.3
KDE Applications 16.12.3


The 'Do not ask again' about executables is write/read from the ~/.config/kiorc.

Can be changed from the Dolphin settings > Configure Dolphin > General > Confirmations. At here the default setting is the 'alwaysAsk'.

Existing KDE bug report: Bug 190238 - Provide a widget to view and change the "do not ask again" saved options - https://bugs.kde.org/show_bug.cgi?id=190238.

I think, that this is the original (2014) review request: Add option to allow execution as well as opening of scripts and desktop files - https://git.reviewboard.kde.org/r/120171/


Bookmarks



Who is online

Registered users: bancha, Bing [Bot], Evergrowing, Google [Bot], lockheed, mesutakcan, sandyvee