6

I want a list of all installed application which have a GUI. To be clear, At least all the applications that are listed in Show Applications.

I tried several commands like apt list --installed, dpkg -l, find '*.desktop' to get the list of all installed application which all ended up missing some applications (like Android Studio, b1freearchiver, pyCharm, etc.)

Wouldn't there be a way to find the folder or file that is used by the Show Applications menu to get all the applications listed in it.

I'm running Ubuntu 18.04 desktop.

3 Answers3

6

Try searching for all the .desktop files, Gnome's Developer website calls them the "registered set of applications that users can run" and they're almost always GUI programs.

This answer (How can I find *.desktop files?) says you could just search everywhere for .desktop files with

find / -name '*.desktop'

Or they're probably only in /usr/share/applications/ and ~/.local/share/applications so just looking in those should be sufficient:

find /usr/share/applications ~/.local/share/applications -name '*.desktop'

If you specifically want to exclude terminal programs (even if they have a terminal GUI like htop), you could append these commands to a search above:

...  -print0 |xargs -0 grep -i -l "Terminal=False"
Xen2050
  • 8,943
4

As compliment to the @Xen2050 answer you can determine exact package names of the deb-packages (so they are known to APT) having *.desktop files with this one-liner:

dpkg --search '*.desktop' | awk '{print $1}' | sed "s/://" | sort --unique

In the command above:

  • dpkg --search '*.desktop' will search for packages having *.desktop files;
  • | is redirect from output of previous command to the input of next command;
  • awk '{print $1}' will print first column of search result (usually in form plank: /usr/share/applications/plank.desktop - so you will get plank:);
  • sed "s/://" will remove unnecessary : from package name (you will get plank here);
  • sort --unique will sort the results and remove duplicates from them.

On my Ubuntu 16.04.5 LTS it returns about 347 unique package names.


If you have installed some software to the home folder - then you can use command below

find ~ -name '*.desktop'

or more precise

find ~/.local/share/applications/ '*.desktop'

to find their *.desktop files.

N0rbert
  • 103,263
0

Generally, that's difficult to determine. The other answers aren't addressing that command line apps also may have .desktop files or GUI apps may not provide a . desktop file. Besides there's no guarantee an app referenced in the .desktop file still exists on the system( you'd have to run it to know or check Exec= line for existing path). Thus it's a poor criteria.

What can be done, however is ask a better question. What apps depend on GUI ? That can be found with apt-cache rdepends 'package or lib'. For instance, apt-cache rdepends libappindicator will show packages that have that lib as dependency and probably provide such applet.

But also to be fair, a terminal app may also interface with GUI without actually having a GUI interface. If your goal to find apps with GUI front-end seek apps that depend on Gtk or Qt libraries

Of course, it also depends of whether package maintainer properly provided dependency description for their package. For standard Ubuntu repositories that's OK. For external PPA that depends on the developers and maintainers.