A library for parsing FreeDesktop entry files
Bump version to 1.3.0
Update to nom 7
Bump version to 1.2.0



You can also use your local clone with git send-email.

#Freedesktop Entry Parser

crates.io docs.rs Minimum Supported Rust Version

A library for parsing FreeDesktop entry files in Rust. These files are used in the Desktop Entry, Icon Theme, and Systemd Unit file. They are similar to ini files but are distinct enough that an ini parse would not work.

#Example Usage

As example input lets use the contents of sshd.service

Description=OpenSSH Daemon

ExecStart=/usr/bin/sshd -D
ExecReload=/bin/kill -HUP $MAINPID


For example, to print the start command we could do this:

use freedesktop_entry_parser::parse_entry;

let entry = parse_entry("./test_data/sshd.service")?;
let start_cmd = entry
    .expect("Attribute doesn't exist");
println!("{}", start_cmd);

This prints /usr/bin/sshd -D

For more extensive documentation see docs.rs or generate the docs yourself by cloning the repo and running cargo doc. For more examples see the examples in the repo.

#MSRV Policy

The current minimum support rustc version is specified above in this readme. We reserve the right to change this on minor version increases, but we will try to keep it reasonable. Given that this library is feature complete, the MSVR will likely only change with our dependencies.


Please send any and all patches, bugs, and questions to my public inbox ~zethra/public-inbox@lists.sr.ht or submit a ticket to the bug tracker if you feel so inclined todo.sr.ht/~zethra/linicon.