Qbs

Blog Documentation Get Qbs
  • Qbs Manual
  • QbsModules
  • freedesktop
  • Qbs 2.3.0
  • freedesktop QML Type

    Provides support for some freedesktop.org specifications. More...

    Import Statement: import QbsModules
    Since: Qbs 1.16

    Properties

    Detailed Description

    The freedesktop module contains properties and rules for building and working with applications compliant to freedesktop.org specifications on UNIX platforms. The areas in which this module can be of use include:

    This module is available on all platforms but is currently only useful on UNIX platforms.

    Example usage

    Application {
        ...
        Depends { name: "freedesktop" }
    
        Group {
            files: [
                ...
    
                // Declare the desktop and appstream files
                "data/my-app.desktop",
                "data/my-app.metainfo.xml",
            ]
        }
    
        // Add/change some fields in the desktop file
        freedesktop.desktopKeys: ({
            'Exec': FileInfo.joinPaths(qbs.installPrefix,
                                       product.installDir,
                                       product.targetName) + ' --argument',
            'X-Application-Version': product.version,
        })
    
        // Declare the application icon
        Group {
            files: "icons/my-application.svg"
            fileTags: "freedesktop.appIcon"
        }
    }

    Relevant File Tags

    TagAuto-tagged File NamesSinceDescription
    "freedesktop.desktopfile_source"*.desktop1.16A source file with this tag is a .desktop file or fragment that will be merged into the application's final .desktop file.
    "freedesktop.desktopfile"-1.16Attached to the output artifacts of the rule that produces the merged .desktop file.
    "freedesktop.appstream"*.metainfo.xml, *.appdata.xml1.16Source files with this tag are AppStream metadata files which will be installed under installPrefix/share/metainfo
    "freedesktop.appIcon"-1.16Source files with this tag are application icons and will be installed under installPrefix/share/icons/hicolor/scalable/apps

    Property Documentation

    appName: string

    The display name of the application which will be stored in the .desktop file.

    Default: product.name


    desktopKeys: var

    A dictionary of key-value pairs to add to the application's .desktop file.

    The contents of this property will be aggregated with the values from any .desktop file. If this property and any .desktop files contain the same key, this property will take precedence.

    Default: Undefined