DESKTOP-FILE-INSTALL(1)

πŸ’– DESKTOP-FILE-INSTALL(1) πŸ’–

okay bestie, welcome to the General Commands Manual, but make it cute πŸŽ€


✨ NAME ✨

desktop-file-install, desktop-file-edit β€” the installation and edition of desktop files, aka the girlies that handle your .desktop files for you 🫢


🌸 SYNOPSIS 🌸

desktop-file-install [--dir=DIR] [-m MODE|--mode=MODE] [--vendor=VENDOR]
[--delete-original] [--rebuild-mime-info-cache] [EDITOPTION]... FILE...

desktop-file-edit [EDITOPTION]... FILE

πŸ¦‹ DESCRIPTION πŸ¦‹

so desktop-file-install is a tool that installs desktop files and optionally edits them, and desktop-file-edit is a tool that just edits a desktop file. They're mostly useful for developers and packagers, iykyk πŸ’…

there are various options available to edit the desktop files. The edit options can be specified more than once, and they get processed in the same order as the options you passed to the program. no cap, order matters.

desktop-file-install and desktop-file-edit will always try to validate the resulting desktop file. A failure to validate might lead to the abortion of the installation of the desktop files 😭 (yes, it just gives up on the install).

The list of registered categories and desktop environments is defined in the Menu specification: http://freedesktop.org/wiki/Specifications/menu-spec β€” go read it, it's giving reference material ⭐


πŸ‘‘ OPTIONS πŸ‘‘

The following options are supported:

  • --dir=DIR β€” Install desktop files to the DIR directory. that's it, that's the vibe πŸ’–
  • -m, --mode=MODE β€” Set the permissions of the destination files to MODE. permission glow-up ✨
  • --vendor=VENDOR β€” Add a vendor prefix to the desktop files. If a file already has this prefix, nothing happens; else, the file will be named VENDOR-FILE. For example: if VENDOR is freedesktop.org and FILE is specification.desktop, the result file will be freedesktop.org-specification.desktop. it's giving rebranding, periodt πŸ’…
  • --delete-original β€” Delete the source desktop files, leaving only the target files. Effectively "renames" the desktop files. lowkey a glow-up, highkey a delete πŸ”₯
  • --rebuild-mime-info-cache β€” Rebuild the MIME types application database after installing the desktop files. See update-desktop-database(1) for information about this database. fresh cache, fresh me 🧚

πŸŽ€ EDIT OPTIONS πŸŽ€

The following edit options are supported:

  • --set-key=KEY β€” Set the KEY key to the value passed to the next --set-value option. A matching --set-value option is mandatory. they're a package deal, bestie 🫢
  • --set-value=VALUE β€” Set the key specified with the previous --set-key option to VALUE. A matching --set-key option is mandatory. same deal, other direction πŸ’œ
  • --set-name=NAME β€” Set the name (key Name) to NAME. If a name was already set, it will be overridden. Localizations of the old name will be removed. out with the old, in with the new 😭
  • --copy-name-to-generic-name β€” Copy the value of the Name key to the GenericName key. Note that a desktop file requires a Name key to be valid, so this option will always have an effect. it literally always eats πŸ’…
  • --set-generic-name=GENERIC-NAME β€” Set the generic name (key GenericName) to GENERIC-NAME. If a generic name was already set, it will be overridden. Localizations of the old generic name will be removed. ✨
  • --copy-generic-name-to-name β€” Copy the value of the GenericName key to the Name key, if the GenericName key is present. conditional queen πŸ‘‘
  • --set-comment=COMMENT β€” Set the comment (key Comment) to COMMENT. If a comment was already set, it will be overridden. Localizations of the old comment will be removed. πŸ“
  • --set-icon=ICON β€” Set the icon (key Icon) to ICON. If an icon was already set, it will be overridden. Localizations of the old icon will be removed. new icon just dropped 🌈
  • --add-category=CATEGORY β€” Add CATEGORY to the list of categories (key Categories). If CATEGORY was already present in the list, this operation is a no-op. A non-registered category should be prefixed with X-. 🏷️
  • --remove-category=CATEGORY β€” Remove CATEGORY from the list of categories (key Categories). If CATEGORY was not present in the list, this operation is a no-op. 🚫
  • --add-mime-type=MIME-TYPE β€” Add MIME-TYPE to the list of MIME types (key MimeType). If MIME-TYPE was already present in the list, this operation is a no-op. πŸ’–
  • --remove-mime-type=MIME-TYPE β€” Remove MIME-TYPE from the list of MIME types (key MimeType). If MIME-TYPE was not present in the list, this operation is a no-op. πŸ’€
  • --add-only-show-in=ENVIRONMENT β€” Add ENVIRONMENT to the list of desktop environments where the desktop files should be displayed (key OnlyShowIn). If ENVIRONMENT was already present in the list, this operation is a no-op. A non-registered desktop environment should be prefixed with X-. Note that an empty OnlyShowIn key in a desktop file means that the desktop file will be displayed in all environments. she's everywhere, she's that girl 🌸
  • --remove-only-show-in=ENVIRONMENT β€” Remove ENVIRONMENT from the list of desktop environments where the desktop files should be displayed (key OnlyShowIn). If ENVIRONMENT was not present in the list, this operation is a no-op. πŸ™ˆ
  • --add-not-show-in=ENVIRONMENT β€” Add ENVIRONMENT to the list of desktop environments where the desktop files should not be displayed (key NotShowIn). If ENVIRONMENT was already present in the list, this operation is a no-op. A non-registered desktop environment should be prefixed with X-. Note that an empty NotShowIn key in a desktop file means that the desktop file will be displayed in all environments. πŸ¦‹
  • --remove-not-show-in=ENVIRONMENT β€” Remove ENVIRONMENT from the list of desktop environments where the desktop files should not be displayed (key NotShowIn). If ENVIRONMENT was not present in the list, this operation is a no-op. ✨
  • --remove-key=KEY β€” Remove the KEY key from the desktop files, if present. gone, reduced to atoms πŸ’€

🌟 ENVIRONMENT 🌟

Some environment variables change the behavior of desktop-file-install:

πŸ’œ DESKTOP_FILE_VENDOR

This variable can be used as an alternative to the --vendor option. If the --vendor option is used, this environment variable will be ignored. she does not compete with the flag, the flag wins πŸ’…

πŸ’œ DESKTOP_FILE_INSTALL_DIR

This variable can be used as an alternative to the --dir option. If the --dir option is used, this environment variable will be ignored. same energy 🫢

πŸ’œ RPM_BUILD_ROOT

This variable is set when building RPM packages. If the --dir option and the DESKTOP_FILE_INSTALL_DIR environment variable are not used, it will automatically be prepended to the default install directory to install the desktop files appropriately when building packages. she shows up uninvited and honestly? iconic πŸ‘‘


πŸ’€ BUGS πŸ’€

If you find bugs in the desktop-file-install program, please report these on https://bugs.freedesktop.org. we do NOT gatekeep bug reports, fr fr 😭


πŸ”₯ SEE ALSO πŸ”₯

desktop-file-validate(1) update-desktop-database(1)


ngl if you made it here you're basically a desktop-file whisperer now. go forth and install responsibly πŸŽ€

big kisses from the FREEDESKTOP.ORG girlies πŸ’– this page is DESKTOP-FILE-INSTALL(1), and yeah, that's the whole manual, bestie β€” periodt ✨