File: README.md

package info (click to toggle)
rust-desktop-edit 0.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 144 kB
  • sloc: makefile: 4
file content (33 lines) | stat: -rw-r--r-- 1,014 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# desktop-edit

A lossless parser and editor for .desktop files as specified by [freedesktop.org Desktop Entry Specification](https://specifications.freedesktop.org/desktop-entry-spec/latest/).

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

```rust
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