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;
use FromStr;
# let input = r#"[Desktop Entry]
# Name=Example Application
# Type=Application
# Exec=example
# Icon=example.png
# "#;
# let desktop = from_str.unwrap;
# assert_eq!;
# let group = desktop.groups.nth.unwrap;
# assert_eq!;
License
Apache-2.0