After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 725023 - Can no longer find apps by executable/desktop file name
Can no longer find apps by executable/desktop file name
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gio
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
: 712604 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2014-02-23 22:58 UTC by Elad Alfassa
Modified: 2018-06-13 14:58 UTC
See Also:
GNOME target: 3.12
GNOME version: ---


Attachments
desktopappinfo: add Exec to searchable keys (4.64 KB, patch)
2014-03-02 14:43 UTC, Allison Karlitskaya (desrt)
committed Details | Review

Description Elad Alfassa 2014-02-23 22:58:18 UTC
I'm used to type "nautilus" or "totem" to start the apps which nowdays show as "Files" or "Videos". This used to work in 3.10.

It no longer works in 3.11. Was it removed on purpose? if so, what is the reasoning for this removal?
Comment 1 Florian Müllner 2014-02-23 23:14:31 UTC
The  implementation moved to glib, which doesn't match on executable name - reassigning.
Comment 2 Emmanuele Bassi (:ebassi) 2014-03-02 11:33:07 UTC
Ryan is supposedly working on this.
Comment 3 Allison Karlitskaya (desrt) 2014-03-02 14:43:32 UTC
Created attachment 270700 [details] [review]
desktopappinfo: add Exec to searchable keys

Add the basename from the first component of the Exec line to the list of
strings to search for via g_desktop_app_info_search().

We treat Exec as a fairly strong match -- just below the visible name.

Add a testcase to make sure everything is working OK.
Comment 4 Allison Karlitskaya (desrt) 2014-03-02 14:44:19 UTC
No match on desktop file ID because it is assumed that people will be moving to reverse-dns style names...  I think Exec is the one that most people cared about in any case.
Comment 5 Yosef Or Boczko 2014-03-02 14:49:24 UTC
I'm wonder what happen if I have something like this:
Exec=env LANG=c monodevelop %F

(I have something like this in some desktop apps without
support for RTL).
Comment 6 Yosef Or Boczko 2014-03-02 14:51:21 UTC
OK, I checked this with nautilus.
If I added 'env LANG=C' I can to find nautilus
in the search result of 'env' but not 'nautilus'.
Comment 7 Allison Karlitskaya (desrt) 2014-03-02 14:52:04 UTC
Another similar situation:

Exec=python /path/to/actualprogram

We discussed this and decided that we don't really want to try to sort out these cases.  It's just too hard to get right.
Comment 8 Elad Alfassa 2014-03-02 14:53:41 UTC
Why not do a partial match on the field?
Comment 9 Yosef Or Boczko 2014-03-02 14:58:48 UTC
To take the name of the desktop file sound simple (generic name?)?
Comment 10 Matthias Clasen 2014-03-02 22:27:51 UTC
Review of attachment 270700 [details] [review]:

Looks good to me

::: gio/tests/desktop-app-info.c
@@ +662,3 @@
+
+  /* make sure we only search the first component */
+  assert_search ("nonsearchable", "", TRUE, FALSE, NULL, NULL);

Would be nice to also have a testcase that exercises the path-stripping
Comment 11 Allison Karlitskaya (desrt) 2014-03-03 02:28:44 UTC
(In reply to comment #10)
> Would be nice to also have a testcase that exercises the path-stripping

I considered this but I was afraid to hardcode a path to 'false' in either /bin or /usr/bin because if we guess the wrong one that GDesktopAppInfo will reject it entirely.

Maybe I should just use /usr/bin/env... it is widely known to always be at that location.
Comment 12 Allison Karlitskaya (desrt) 2014-03-03 21:01:42 UTC
Attachment 270700 [details] pushed as 5d5ea49 - desktopappinfo: add Exec to searchable keys
Comment 13 Philip Withnall 2017-09-13 12:12:16 UTC
*** Bug 712604 has been marked as a duplicate of this bug. ***
Comment 14 Debarshi Ray 2018-06-13 13:30:59 UTC
(In reply to Yosef Or Boczko from comment #5)
> I'm wonder what happen if I have something like this:
> Exec=env LANG=c monodevelop %F
> 
> (I have something like this in some desktop apps without
> support for RTL).

(In reply to Yosef Or Boczko from comment #6)
> OK, I checked this with nautilus.
> If I added 'env LANG=C' I can to find nautilus
> in the search result of 'env' but not 'nautilus'.

(In reply to Allison (desrt) from comment #7)
> Another similar situation:
> 
> Exec=python /path/to/actualprogram
> 
> We discussed this and decided that we don't really want to try to sort out
> these cases.  It's just too hard to get right.

While playing with Fedora Silverblue, I found myself digging through GDesktopAppinfo, and found that this was recently addressed in bug 795488
Comment 15 Florian Müllner 2018-06-13 14:39:22 UTC
(In reply to Debarshi Ray from comment #14)
> (In reply to Allison (desrt) from comment #7)
> > Another similar situation:
> > 
> > Exec=python /path/to/actualprogram
> > 
> > We discussed this and decided that we don't really want to try to sort out
> > these cases.  It's just too hard to get right.
> 
> While playing with Fedora Silverblue, I found myself digging through
> GDesktopAppinfo, and found that this was recently addressed in bug 795488

Well, it depends on how you look at it - searching for "python" will no longer return "random" matches, but you still cannot search for "actualprogram" ...
Comment 16 Debarshi Ray 2018-06-13 14:58:41 UTC
(In reply to Florian Müllner from comment #15)
> (In reply to Debarshi Ray from comment #14)
> > (In reply to Allison (desrt) from comment #7)
> > > Another similar situation:
> > > 
> > > Exec=python /path/to/actualprogram
> > > 
> > > We discussed this and decided that we don't really want to try to sort out
> > > these cases.  It's just too hard to get right.
> > 
> > While playing with Fedora Silverblue, I found myself digging through
> > GDesktopAppinfo, and found that this was recently addressed in bug 795488
> 
> Well, it depends on how you look at it - searching for "python" will no
> longer return "random" matches, but you still cannot search for
> "actualprogram" ...

Yes, that's why I started digging in the first place. I saw that typing "epiphany" wouldn't get me a hit in gnome-shell; then I saw that typing "flatpak" shows me everything. When I saw the code I realized that you had addressed the second problem. :)

I filed https://gitlab.gnome.org/GNOME/glib/issues/1417 for the original problem of not being to search using the executable name.