Freedesktop Desktop Entry Parser
A Rust library for parsing and manipulating Linux .desktop
files according to the freedesktop.org Desktop Entry Specification.
Features
- Full support for Desktop Entry Specification v1.5
- Locale-aware string handling
- Icon resolution using freedesktop icon theme
- Support for desktop actions
- Strong type safety with Rust's type system
Usage
Add this to your Cargo.toml
:
[]
= "0.1.0"
Basic Example
use parse;
Handling Localized Strings
use LocaleString;
// Access different translations
if let Some = desktop_file.entry.name.variants.get
Working with Actions
// Access application actions
for in &desktop_file.actions
Supported Fields
The library supports all standard fields from the Desktop Entry Specification, including:
- Basic fields (Type, Name, GenericName, NoDisplay, Comment, Icon)
- Application fields (Exec, TryExec, Path, Terminal, MimeType, Categories)
- Startup fields (StartupNotify, StartupWMClass)
- Display fields (Hidden, OnlyShowIn, NotShowIn)
- Actions
- DBus activation
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- freedesktop.org for the Desktop Entry Specification
- freedesktop-icons for icon resolution support
Status
This project is under active development. While it implements the full specification, please report any bugs or missing features.