desktop-edit 0.1.1

A lossless parser and editor for .desktop files
Documentation
  • Coverage
  • 96.88%
    31 out of 32 items documented1 out of 1 items with examples
  • Size
  • Source code size: 54.63 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 6.21 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 26s Average build duration of successful builds.
  • all releases: 24s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • jelmer

desktop-edit

A lossless parser and editor for .desktop files as specified by freedesktop.org Desktop Entry Specification.

This library preserves all whitespace, comments, and formatting while providing a structured way to read and modify .desktop files.

Features

  • Lossless parsing: All whitespace, comments, and formatting are preserved
  • FreeDesktop .desktop file support: Full support for the freedesktop.org Desktop Entry specification
  • Locale support: Handle localized keys like Name[de]=...

Example

use desktop_edit::Desktop;
use std::str::FromStr;

# let input = r#"[Desktop Entry]
# Name=Example Application
# Type=Application
# Exec=example
# Icon=example.png
# "#;
# let desktop = Desktop::from_str(input).unwrap();
# assert_eq!(desktop.groups().count(), 1);
# let group = desktop.groups().nth(0).unwrap();
# assert_eq!(group.name(), Some("Desktop Entry".to_string()));

License

Apache-2.0