Add the possibility of "run scripts in konsole" when using dolphin
Review Request #107086 - Created Oct. 27, 2012 and submitted
@David, I'd like to know your idea of this workaround, because I think its usefulness will influence or be influenced by how bug 275405 will be finally resolved. The current situation of clicking an executable shell script in dolphin/konqueror: 1. It is always executed, instead of being opened by the preferred application according to its mimetype. (bug 275405) 2. It is executed in a silent way, without invoking konsole to provide a running environment (bug 225563). That means at least two issues: a). There is no feedback and no easy way for user to know whether that script has been started. He/She need use ps or ksysguard to verify it. b). interactive script just doesn't work. This patch *doesn't* really solve any of the above two problems. It just provides the possibility for users to run an executable script in konsole when using dolphin/konqueror. It adds two .desktop files: applications/kde4/run-in-konsole.desktop, which can be used in the "Open with" submenu ServiceMenus/konsolerun.deksotp, which can be used in the "Actions" submenu I'm not sure which solution is better, so I just provide both :)
|I mean: Exec=%f Terminal=true This will run %f in a terminal, won't it?||David Faure|
Jekyll, just a quick note to let you know that I appreciate any improvements in this area! I've been hit by this issue quite a few times myself when I clicked shell scripts or Python scripts and wondered what they did in the end. Being able to open them in a Konsole would definitely be an improvement. There is bug 172038 which is about showing a dialog when clicking a script ("Run/Run in Konsole/Edit/Cancel"), just like Nautilus does. I don't know how this could be implemented in a clean way, but I like the idea. At least if there was also a "Don't ask again" checkbox in the dialog and the possibility to change that choice in the settings.
Just my 0.02ct: What I would find really really cool, don't know if the interaction is possible without doing big hacks inside the codebase is, if you click a script, Dolphin's integrated shell toolbar (aka press F4 key) opens and runs the script, rather than invoking a new window.
About bug 275405: I just posted a patch there, can you try it? > Does it make sense to provide that workaround for binary executable? It is of course valid, but might be seen as overkill and strange in practice. As long as it's "opt in", i.e. people need to choose this menuitem explicitely, I like having it for all types of executables. Someone who wants to see the debug output of a GUI app will be able to do it that way, instead of launching a terminal first and then the app from there, so this sounds useful. > * Is there something called application/x-executablescript, that falls between the range of x-executable and x-shellscripts ? No, the freedesktop spec uses multiple inheritance (from x-executable and text/plain) to represent scripts. But that's hard to specify in a MimeType= field, no support for predicates there :-) > * Should application/x-desktop be also added into "MimeType"? Can't hurt; same reasoning as for the first question. As to application desktop file or servicemenu... if we decide this only makes sense inside dolphin/konqueror, then it's a servicemenu. If we want to let people associate other mimetypes with it externally, then it could be a hidden application. I guess one could try if the application desktop file allows to make this work inside folderview too, for instance...
That's the default, so this line is unnecessary. However I suppose you tried Terminal=true instead of Exec=konsole --hold -e %f? It's supposed to do the same (but uses the user's configured terminal emulator). Doesn't that work? Of course it would mean changing the Name from "Run In Konsole" to "Run in terminal window" (to match the label of the checkbox in krunner).
use application/x-executable instead of application/x-shellscript remove "Verion=1.0" line remove "Terminal=false" line
Revision 3 (+26 -1)