#desktop #entry #freedesktop

freedesktop-desktop-entry

Freedesktop Desktop Entry Specification

22 releases

0.7.7 Jan 23, 2025
0.7.5 Sep 5, 2024
0.7.0 Jul 16, 2024
0.5.1 Mar 11, 2024
0.1.1 Jul 7, 2019

#53 in Unix APIs

Download history 1230/week @ 2024-10-22 1654/week @ 2024-10-29 1702/week @ 2024-11-05 1512/week @ 2024-11-12 1111/week @ 2024-11-19 829/week @ 2024-11-26 1355/week @ 2024-12-03 1526/week @ 2024-12-10 2195/week @ 2024-12-17 2343/week @ 2024-12-24 2118/week @ 2024-12-31 3988/week @ 2025-01-07 4959/week @ 2025-01-14 6358/week @ 2025-01-21 4517/week @ 2025-01-28 5469/week @ 2025-02-04

21,772 downloads per month
Used in 11 crates (10 directly)

MPL-2.0 license

44KB
1K SLoC

Freedesktop Desktop Entry Specification

crates.io docs.rs

This crate provides a library for efficiently parsing Desktop Entry files.

use freedesktop_desktop_entry::{default_paths, get_languages_from_env, Iter, PathSource};

fn main() {
    let locales = get_languages_from_env();

    let entries = Iter::new(default_paths())
        .entries(Some(&locales))
        .collect::<Vec<_>>();
    
    for entry in entries {
        let path_src = PathSource::guess_from(&entry.path);

        println!("{:?}: {}\n---\n{}", path_src, entry.path.display(), entry);
    }
}

License

Licensed under the Mozilla Public License 2.0. Permissions of this copyleft license are conditioned on making available source code of licensed files and modifications of those files under the same license (or in certain cases, one of the GNU licenses). Copyright and license notices must be preserved. Contributors provide an express grant of patent rights. However, a larger work using the licensed work may be distributed under different terms and without source code for files added in the larger work.

Contribution

Any contribution intentionally submitted for inclusion in the work by you shall be licensed under the Mozilla Public License 2.0 (MPL-2.0). It is required to add a boilerplate copyright notice to the top of each file:

// Copyright {year} {person OR org} <{email}>
// SPDX-License-Identifier: MPL-2.0

Dependencies

~15–28MB
~163K SLoC