DESKTOPTOJSON(8)
π
DESKINTOJSON... wait, desktoptojson β NAME β¨
okay bestie, say hi to desktoptojson β the KDE Frameworks: KService little icon that converts a .desktop file to a .json file. that's it, that's the job, and it does it flawlessly π
π¦ SYNOPSIS π¦
desktoptojson --input DESKTOP-FILE --output JSON-FILE
desktoptojson {--version | --help}
like. two modes. do the conversion, or ask it who it is. simple as that π
β¨ DESCRIPTION β¨
so here's the lore, bestie π the KService framework uses the info sitting inside .desktop files to locate services, including plugins for Qt5-based applications and libraries. but the Qt5 plugin system? it doesn't do .desktop files at all β it uses JSON data embedded in the plugin itself π
and that is literally the whole reason desktoptojson exists: it lets the info in a .desktop file also be used as the embedded data for a Qt5 plugin, by converting the .desktop file entries into JSON data. iconic behavior, truly π«Ά
now, the generated JSON data is a JSON object that maps the entries from the [Desktop Entry] group of the .desktop file. any other groups? ignored. not invited to the party π
most entries just get converted to JSON strings, but some entries (like Hidden and X-KDE-PluginInfo-EnabledByDefault) are known to be boolean values and get converted as such. and similarly, some entries (like X-KDE-ServiceTypes and X-KDE-PluginInfo-Depends) are always converted to arrays of strings. no cap π―
πΈ OPTIONS πΈ
--input DESKTOP-FILEβ the.desktopfile to convert. the source material, the moment, the muse π--output JSON-FILEβ the file to write the generated JSON data to. where the magic lands β¨--helpβ show a brief help text. a lil recap for when you forgot π--versionβ show version information. identity check πͺ
π USAGE π
okay so most users of this utility are gonna be using the CMake macro kservice_desktop_to_json as part of the process of building a plugin. it's giving automation, it's giving build-system energy π§
add_library(myplugin MODULE ${myplugin_SRCS})
kservice_desktop_to_json(myplugin myplugin.desktop)
this will produce the JSON file myplugin.json, which can be referenced from the K_PLUGIN_FACTORY_WITH_JSON or Q_PLUGIN_METADATA macros. slay π
π BUGS π
found something cursed? please use KDE's bugtracker[1] to report bugs. they wanna know, fr fr π
π AUTHORS π
- Scarlett Clark
<scarlett@scarlettgatelyclark.com>- wrote the original documentation. the blueprint, the blueprint-er π
- Alex Merry
<alexmerry@kde.org>- edited the documentation. the glow-up era β¨
π NOTES π
- KDE's bugtracker
https://bugs.kde.org
and that's the whole page, bestie π₯° this was KDE Frameworks Frameworks 5.0, dated 2014-04-02, living under section 8 of the manual β DESKTOPTOJSON(8), periodt. go convert something cute ππ¦πΈ
π¦ where this page comes from
- debian bookworm: libkf5service-bin 5.103.0-1 Β· LGPL-2.0-only
- debian trixie: libkf5service-bin 5.116.0-1 Β· LGPL-2.0-only
- epel 9: kf5-kservice 5.116.0-1.el9 Β· CC0-1.0 AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-only AND LGPL-2.0-only AND LGPL-2.0-or-later AND LGPL-2.1-only AND LGPL-3.0-only AND (GPL-2.0-only OR GPL-3.0-only) AND (LGPL-2.1-only OR LGPL-3.0-only)
- fedora 43: kf5-kservice 5.116.0-4.fc43 Β· CC0-1.0 AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-only AND LGPL-2.0-only AND LGPL-2.0-or-later AND LGPL-2.1-only AND LGPL-3.0-only AND (GPL-2.0-only OR GPL-3.0-only) AND (LGPL-2.1-only OR LGPL-3.0-only)
- fedora 43: kf5-kservice 5.116.0-4.fc43 Β· CC0-1.0 AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-only AND LGPL-2.0-only AND LGPL-2.0-or-later AND LGPL-2.1-only AND LGPL-3.0-only AND (GPL-2.0-only OR GPL-3.0-only) AND (LGPL-2.1-only OR LGPL-3.0-only)
- fedora 44: kf5-kservice 5.116.0-5.fc44 Β· CC0-1.0 AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-only AND LGPL-2.0-only AND LGPL-2.0-or-later AND LGPL-2.1-only AND LGPL-3.0-only AND (GPL-2.0-only OR GPL-3.0-only) AND (LGPL-2.1-only OR LGPL-3.0-only)
- fedora 44: kf5-kservice 5.116.0-5.fc44 Β· CC0-1.0 AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-only AND LGPL-2.0-only AND LGPL-2.0-or-later AND LGPL-2.1-only AND LGPL-3.0-only AND (GPL-2.0-only OR GPL-3.0-only) AND (LGPL-2.1-only OR LGPL-3.0-only)
- opensuse-leap 16.0: kservice 5.116.0-bp160.1.14 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: kservice 5.116.0-bp160.1.14 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: kservice 5.116.0-bp160.1.14 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: kservice 5.116.0-bp160.1.14 Β· LGPL-2.1-or-later
- ubuntu jammy: libkf5service-bin 5.92.0-0ubuntu1 Β· LGPL-2.0-only
- ubuntu noble: libkf5service-bin 5.115.0-0ubuntu4 Β· LGPL-2.0-only
- ubuntu resolute: libkf5service-bin 5.116.0-1ubuntu1 Β· LGPL-2.0-only
- ubuntu stonking: libkf5service-bin 5.116.0-1ubuntu1 Β· LGPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms