Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- gnome-system-monitor
- Application name || desktop file || command
- ===============================================================
- Cheese || cheese.desktop || cheese
- Ubuntu Software Center || ubuntu-software-center.desktop || /usr/bin/software-center %u
- eBook speaker || eBook-speaker.desktop || eBook-speaker %f
- Vuze || azureus.desktop || azureus %f
- Mines || gnomine.desktop || gnome-mines
- Shotwell || shotwell.desktop || shotwell %U
- Synaptic Package Manager || synaptic-kde.desktop || synaptic
- #!/usr/bin/python3
- import os
- dtfile_list = os.listdir("/usr/share/applications")
- for item in dtfile_list:
- if item.endswith(".desktop"):
- with open("/usr/share/applications/"+item) as commandlist_source:
- searchlines = commandlist_source.readlines()
- try:
- command_data = ([
- line for line in searchlines if line.startswith("Name=")
- ][0].replace("Name=", "").replace("n", ""),
- [
- line for line in searchlines if line.startswith("Exec=")
- ][0].replace("Exec=", "").replace("n", ""))
- print(command_data[0]," || ", item, " || ", command_data[1])
- except Exception:
- pass
- python3 get_commands.py
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement