trinity-users@lists.pearsoncomputing.net

Message: previous - next
Month: December 2015

Re: [trinity-users] Re: cannot launch shell script - question

From: Slávek Banko <slavek.banko@...>
Date: Mon, 21 Dec 2015 17:27:13 +0100
On Monday 21 of December 2015 16:35:16 Michele Calgaro wrote:
> On 12/15/2015 11:37 PM, Giuliano Colla wrote:
> > Il 15/12/2015 14:19, Giuliano Colla ha scritto:
> >> I'm running TDE 14.0.2 on CentOs 6. My compliments to the trinity team
> >> for the excellent job! I've got back all the reach features of KDE 3,
> >> instead of a bloated and much less usable Plasma thing.
> >>
> >> However I've stumbled into an annoying issue.
> >>
> >> When clicking on the icon of an executable shell script (extension .sh),
> >> it's opened for editing in Kate, and not launched. The same, under KDE4
> >> is properly executed.
> >>
> >> Is it a matter of some improper setting that I can fix, or a bug?
> >>
> >> Additional information. Looking to the file properties, I see that it's
> >> using the settings for the group "text".
> >>
> >> In /opt/trinity/share/mimelink I find both
> >>
> >> /text/x-shellscript.desktop
> >>
> >> which has a line: X-TDE-IsAlso=application/x-executable-script and a
> >> line [Property::X-TDE-text]
> >>
> >> and
> >>
> >> /application/x-shellscript.desktop
> >>
> >> which has the two identical line, which make little sense IMHO because
> >> if I understand properly they tell that it's also itself, and that it
> >> should be treated as text.
> >
> > For anyone interested, I've solved the problem!
> >
> > I have simply removed x-shellscript.desktop from the mimelnk/text
> > directory, leaving only the one in the mimelnk/applications and now it
> > works as expected. That is, if the script is marked as executable,
> > clicking on it it is executed. If not it is opened in an editor.
> >
> > Giuliano
>
> Actually it is not necessary to remove the file
> /text/x-shellscript.desktop. It is sufficient to remove the entry for shell
> scripts in the "text" category in Konqueror's File Associations settings.
>
>
> Slavek, currently tdelibs ships with two files for x-shellscript.desktop:
> /opt/trinity/share/mimelnk/application/x-shellscript.desktop
> /opt/trinity/share/mimelnk/text/x-shellscript.desktop
> I think it would be better to associate shell scripts with one only. IMO
> most of the users would expect shell scripts to be executed when clicking
> on it from Konqueror.
> What do you think?
>
> Any opinion from the other users?
>
> Cheers
>   Michele
>

There is a need to act with caution. As I found when examining the problem 
KNotify => problem with playing ogg (see bug 2392), there is an important 
relationship between mime types obtained by calling libmagic and mime types 
defined in TDE. Missing definition in TDE may cause a problem with the 
functionality. It is also necessary to keep in mind that different versions 
libmagic may return different types - as is application/ogg × audio/ogg.

The ideal solution would be to leave the /opt/trinity/share/mimelnk in favor 
of the system /usr/share/mime. But it will require some effort.

Related links:
+ http://trinity-users.pearsoncomputing.net/?0::9572
+ http://bugs.pearsoncomputing.net/show_bug.cgi?id=2392

-- 
Slávek