In Ubuntu, where to see all programs just like the "program files" in windows, from which I can launch a program from a list of all program installed?
-
1Probably software center is best, although there is no equivalent of "program files" in linux. – Panther Jan 06 '16 at 16:47
3 Answers
Just for fun
Since OP mentioned: from which I can launch a program from a list of all program installed?
Below a small script that lists all (globally) installed GUI applications. Choose one to launch it, or type a few of its characters and press Return to run the application:
To use
- Copy the script below into an empty file, save it as
list_apps.py
Test- run it by the command (open a terminal window, type the command and press Return):
python3 /path/to/list_apps.py
If all works fine, add it to a shortcut key: choose: System Settings > "Keyboard" > "Shortcuts" > "Custom Shortcuts". Click the "+" and add the command:
python3 /pat/to/list_apps.py
to a shortcut key combination you like.
The script
#!/usr/bin/env python3
import subprocess
import os
dr = "/usr/share/applications"
apps = []
for f in [f for f in os.listdir(dr) if f.endswith(".desktop")]:
try:
content = open(dr+"/"+f).read()
if not "NoDisplay=true" in content:
lines = content.splitlines()
name = [l for l in lines if l.startswith("Name=")][0].replace("Name=", "")
command = [l for l in lines if l.startswith("Exec=")][0].replace("Exec=", "")
apps.append([name, command])
except:
pass
apps.sort(key=lambda x: x[0]); apps = sum(apps, [])
displ_list = '"'+'" "'.join(apps)+'"'
try:
chosen = subprocess.check_output([
"/bin/bash",
"-c",
'zenity --list '+\
'--column="Applications" '+\
'--column="commands" '+\
'--hide-column=2 --height 450 '+\
'--width 300 '+\
'--print-column=2 '+displ_list
]).decode("utf-8").split("|")[-1].strip()
chosen = chosen[:chosen.rfind(" ")] if "%" in chosen else chosen
subprocess.Popen([
"/bin/bash", "-c", chosen
])
except subprocess.CalledProcessError:
pass
How it works
The script lists all .desktop
files in /usr/share/applications
, and checks if the line NoDisplay=true
is in the file (which means it is not meant to be used as a GUI). Then it looks into the files, looks up the application name and the command to run it.
The result is listed in a zenity
list, to choose from. If you pick one, the corresponding command is executed.
That's it.
Extended version
If you also would like to have a short description on the application, As mentioned in the Comment=
line of its .desktop
file, use the version below:
#!/usr/bin/env python3
import subprocess
import os
dr = "/usr/share/applications"
apps = []
for f in [f for f in os.listdir(dr) if f.endswith(".desktop")]:
try:
content = open(dr+"/"+f).read()
if not "NoDisplay=true" in content:
lines = content.splitlines()
name = [l for l in lines if l.startswith("Name=")][0].replace("Name=", "")
command = [l for l in lines if l.startswith("Exec=")][0].replace("Exec=", "")
comment = [l for l in lines if l.startswith("Comment=")]
comment = comment[0].replace("Comment=", "") if comment else "No description"
apps.append([name, command, comment])
except:
pass
apps.sort(key=lambda x: x[0]); apps = sum(apps, [])
displ_list = '"'+'" "'.join(apps)+'"'
try:
chosen = subprocess.check_output([
"/bin/bash",
"-c",
'zenity --list '+\
'--column="Applications" '+\
'--column="commands" '+\
'--column="Description" '+\
'--hide-column=2 --height 450 '+\
'--width 500 '+\
'--print-column=2 '+displ_list
]).decode("utf-8").split("|")[-1].strip()
chosen = chosen[:chosen.rfind(" ")] if "%" in chosen else chosen
subprocess.Popen([
"/bin/bash", "-c", chosen
])
except subprocess.CalledProcessError:
pass

- 83,767
On ubuntu not all the program are listed in the application menu.
To see them all you will need to open a console and type
dpkg -l
This will display all application (the one which run in the UI and the one running in the console)

- 250
-
2No, that displays the list of software packages that are installed. Many packages ( especially those that contain command line programs ) contain multiple applications, and many packages contain none ( they are libraries or data files used by other applications ). – psusi Jan 06 '16 at 22:03
If you want to launch applications from the list a nice option is Classic Gnome indicator.
sudo apt-get install classicmenu-indicator
See here: http://www.howtogeek.com/189929/how-to-install-and-launch-the-classic-gnome-menu-in-ubuntu-14.04/

- 5,597
-
-
Thank you very much for the answer. I install it in my superuser account. However, it only shows a very small part of the pragrams. Interstingly, it works perfectly in my other normal user account and shows all the programs as shown in your figure. Do you have any idea why, and how to fix it? – velut luna Jan 24 '16 at 01:36
-
Maybe, the Main Menu entries should be edited. Try searching it from the list of the apps. – Muzaffar Jan 24 '16 at 02:14
-
Thanks Muzaffar, one more thing, how to uninstall it, just in case I want to later? – velut luna Jan 24 '16 at 02:25
-
Thanks Muzaffar, one more thing, how to uninstall it, just in case I want to later? – velut luna Jan 24 '16 at 02:34
-