This is a parser for the .desktop
file format. It's used in Desktop Creator.
pip install desktop-parser
git clone https://github.com/DesktopCreatorTeam/desktop-parser
cd desktop-parser
poetry install
yay -S python-desktop-parser
from desktop_parser import DesktopFile
# Parse a file
desktop_file = DesktopFile.from_file("path/to/file.desktop")
desktop_file.data["Name"] = "New Name"
desktop_file.data["Exec"] = "new-exec"
# Save the file
desktop_file.save("path/to/file.desktop")
The documentation is available here.
This project is licensed under the GNU GPLv3 license - see the LICENSE.md file for details.
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.