#xdg #mime #default #query #file #system #apps

xdg-utils

Query system for default apps using XDG MIME databases. Rust implementations of some common functions in the freedesktop project xdg-utils.

4 releases

Uses old Rust 2015

0.4.0 Nov 28, 2020
0.3.2 Nov 28, 2020
0.3.1 Sep 13, 2020
0.3.0 Feb 2, 2020

#1147 in Filesystem

Download history 2/week @ 2024-07-19 28/week @ 2024-07-26 6/week @ 2024-08-02 1/week @ 2024-08-09 1/week @ 2024-08-23 2/week @ 2024-08-30 17/week @ 2024-09-20 6/week @ 2024-09-27 2/week @ 2024-10-04

154 downloads per month
Used in core-dev

GPL-3.0-or-later

18KB
273 lines

xdg-utils

GitHub license Crates.io docs.rs

Query system for default apps using XDG MIME databases.

The xdg-utils library provides dependency-free (except for std) Rust implementations of some common functions in the freedesktop project xdg-utils.

What is implemented?

  • Function query_default_app performs like the xdg-utils function binary_to_desktop_file but returns the command string to be executed instead of the path of the desktop file.
  • Function query_mime_info launches the mimetype or else the file command.

Some of the utils may be implemented by combining these functions with other functions in the Rust standard library.

Name Function Implemented functionalities
xdg-desktop-menu Install desktop menu items no
xdg-desktop-icon Install icons to the desktop no
xdg-icon-resource Install icon resources no
xdg-mime Query information about file type handling and install descriptions for new file types queries only
xdg-open Open a file or URL in the user's preferred application all (combine crate functions with std::process::Command)
xdg-email Send mail using the user's preferred e-mail composer no
xdg-screensaver Control the screensaver no

Specification

https://specifications.freedesktop.org/mime-apps-spec/mime-apps-spec-latest.html

Reference implementation

https://cgit.freedesktop.org/xdg/xdg-utils/tree/scripts/xdg-utils-common.in

Help / Feature requests/ Bugs

While this library was created for the meli project, it is intended for general use. Thus you can report bugs and/or request features in the crate's repository on github, git.meli.delivery or the meli mailing-list

No runtime deps