Getting list of installed apps (NOT packages)

How can I get checklist of mounted applications (based at documents in/ usr/share/applications/) without creating very own parser? I require simply app name, course to application symbol and also course to release application.

I'm making use of C+npls with Qt collections. Certainly, you can write me shell command or another thing like it.

1
2022-06-07 14:40:12
Source Share
Answers: 2

As much as I bear in mind /usr/share/applications/ is Gnome windows supervisor details and also does not have an access for every single application on your system (BTW you need to specify what do you suggest by application).

Regardless you can simply detail the access in the directory site

0
2022-06-07 15:09:06
Source

Here is a fast - and also - unclean shell manuscript that could aid you. Readjust the result layout to something that is very easy to parse for you. Locating the appropriate symbol can make use of some renovation to select the highest possible resolution photo. Possibly there is a far better means to get the optimum symbol making use of gconftool or something, I do not recognize.

#!/bin/sh

icon_basedir1=/usr/share/icons/gnome
icon_basedir2=/usr/share/icons/hicolor
icon_basedir3=/usr/share/pixmaps
icon_basedir4=/usr/share/app-install/icons

error() {
    echo $*
    exit 1
}

is_icon() {
    test -f "$1" && icon_path="$1" && return 0
    icon_path=$(find $2 -name $1.png | sort -r | head -n 1)
    test -f "$icon_path" && return 0
}

find_icon() {
    test "$icon_filename" || return
    is_icon $icon_filename $icon_basedir1 && return
    is_icon $icon_filename $icon_basedir2 && return
    is_icon $icon_filename $icon_basedir3 && return
    is_icon $icon_filename $icon_basedir4 && return
}

find_name() {
    test "$fullname" && name=$fullname && return 0
    test "$genericname" && name=$genericname && return 0
}

find /usr/share/applications -type f -name \*.desktop | while read file; do
    icon_filename=$(cat $file | grep ^Icon= | sed -ne 's/^.*=//' -e '1 p')
    find_icon
    executable_name=$(cat $file | grep ^Exec= | sed -ne 's/^.*=//' -e 's/ .*//' -e '1 p')
    fullname=$(cat $file | grep FullName.en_ | sed -ne 's/^.*=//' -e '1 p')
    genericname=$(cat $file | grep GenericName.en_ | sed -ne 's/^.*=//' -e '1 p')
    name=$(cat $file | grep -i Name | sed -ne 's/^.*=//' -e '1 p')
    find_name
    echo app_file=$file
    echo name=$name
    echo executable=$(which $executable_name || echo $executable_name)
    echo icon=$icon_path
    echo
done
1
2022-06-07 14:44:34
Source