Cerebro: Get applications list on Linux

Created on 13 Jan 2017  路  15Comments  路  Source: cerebroapp/cerebro

Cerebro has a lot of plugins, but most used of them is searching and launching applications. There is a plugin to do it on OSx.

Now we need to add a plugin to do the same on linux, so we need:

  1. Find a way to get list of all installed applications and cache this list;
  2. This list should contain human-friendly name of application and path to this application to run it;
  3. Later we should find a way to display application icon in list.
enhancement linux

Most helpful comment

Test build in #62. @hotice @vessd @evsign would be cool if you can check it

All 15 comments

  1. For getting list of all applications you can search all executable from $PATH variable.
  2. For human-friendly names you can search and parse *.desktop files in /usr/share/applications or ~/.local/share/applications
  3. Parse *.desktop files and get path to icons

@evsign awesome, I'll try it:) Should it work for different systems (ubuntu, freebsd, debian) or only for some of them?

Here's a screenshot from a similar application with the paths where it looks for .desktop files: http://i.imgur.com/j73W2m2.png . This should cover most, if not all Linux distributions.

This should work on most distributions. But it is better to use the specification.

But also remember to search for Snaps, which are pretty new...

@hotice
Hmm, snap allows you to install two versions of the application. How then parse desktop files?
As for me, it is better to leave this issue for later. These applications are not so common.

@vessd that I do not know, I am sorry. But snaps are pretty popular in Ubuntu already...

Awesome, thanks for links @vessd @hotice, it will help a lot!

Test build in #62. @hotice @vessd @evsign would be cool if you can check it

It works for me, but there are no application icons (but I assume that's intended for now). Would it be possible to also search in the "Keywords" field in the .desktop files, and not just the "Name" field?

@hotice do you think it makes sense? I thought about it, but I'm afraid it can generate a noise. Do you have an example or what you search and expect to see, but don't get?

That's how for example Unity Dash (the menu in Ubuntu with Unity) or the GNOME Shell Application search works. For example, the default GNOME text editor used to be called "Gedit", so without keywords, one might not have easily found it if it didn't know what it does (that's not the case for this application any more, as it's desktop file now uses "Text Editor" for its name).

Indeed, it might cause some noise for an application like Cerebro, which is not supposed to display a large list of results, so maybe it's not suitable for it. I've only used Cerebro for a few minutes and I'm not sure how it works under the hood, but usually similar quick launch applications display the most used results to the top of the search results, so in that case the noise shouldn't matter. But I don't know if Cerebro does this.

@hotice thanks for so detailed explanation! Looks reasonable, but for now I didn't find a way to get most used applications on linux and windows, so applications search result just sorted by name if it matches search.

So, I'd leave it as I have now and add keywords search later, when we find a way to get most used applications

@KELiON when will the next release containing these updates be (roughly) :).

Cheers.

@CrashyBang just released

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kylewebdev picture kylewebdev  路  4Comments

yunionlassalle picture yunionlassalle  路  6Comments

AlexSHoffman picture AlexSHoffman  路  4Comments

egoist picture egoist  路  6Comments

mijoharas picture mijoharas  路  3Comments