#desktop #entry #freedesktop

freedesktop-desktop-entry

Freedesktop Desktop Entry Specification

10 releases

0.5.1 Mar 11, 2024
0.5.0 Jan 15, 2022
0.4.1 Dec 20, 2021
0.4.0 Aug 20, 2021
0.1.1 Jul 7, 2019

#112 in Unix APIs

Download history 949/week @ 2023-12-06 973/week @ 2023-12-13 1203/week @ 2023-12-20 969/week @ 2023-12-27 1024/week @ 2024-01-03 1211/week @ 2024-01-10 1234/week @ 2024-01-17 1470/week @ 2024-01-24 1468/week @ 2024-01-31 1349/week @ 2024-02-07 2059/week @ 2024-02-14 2054/week @ 2024-02-21 1706/week @ 2024-02-28 1780/week @ 2024-03-06 2044/week @ 2024-03-13 2788/week @ 2024-03-20

8,593 downloads per month
Used in 3 crates (2 directly)

MPL-2.0 license

16KB
324 lines

Freedesktop Desktop Entry Specification

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

use std::fs;

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

fn main() {
    for path in Iter::new(default_paths()) {
        let path_src = PathSource::guess_from(&path);
        if let Ok(bytes) = fs::read_to_string(&path) {
            if let Ok(entry) = DesktopEntry::decode(&path, &bytes) {
                println!("{:?}: {}\n---\n{}", path_src, 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

~12MB
~88K SLoC