Desktop File
About
desktop-file is a tool to create desktop shortcuts for windows and linux.
Installation
To install desktop-file you need python 3 or later with pip installed.
Then you can install it by typing pip install desktop_file or by cloning or downloading this repository on github and executing python setup.py install
Usage
Python
You can use it in your python script like this:
>>> import desktop_file
>>> # get desktop and start menu folders
>>> desktop_file.getDesktopPath()
/home/PyRectangle/Desktop
>>> desktop_file.getMenuPath()
/home/PyRectangle/.local/share/applications
>>> # create a xterm shortcut
>>> shortcut = desktop_file.Shortcut("/home/PyRectangle/Desktop", "xterm", "/usr/bin/xterm")
>>> # Setting the title causes the file to have a different name instead of the file name (only affects linux)
>>> shortcut.setTitle("XTerm")
>>> shortcut.setWorkingDirectory("/home/PyRectangle")
>>> shortcut.setComment("A desktop file to start xterm")
>>> # Only files that contain icons work on Windows
>>> shortcut.setIcon("/usr/share/pixmaps/mini.xterm_48x48.xpm")
>>> # Categories don't have any effects on Windows
>>> shortcut.setCategories("System;")
>>> shortcut.save()
You will find a working shortcut named "XTerm" in the folder "/home/PyRectangle/Desktop"
Command
You can use python -m desktop_file or desktop-file to create shortcuts like this:
desktop-file --exec /usr/bin/xterm --workpath /home/PyRectangle --title XTerm --comment "A desktop file to start xterm" --icon /usr/share/pixmaps/mini.xterm_48x48.xpm --categories "System;" /home/PyRectangle/Desktop/xterm.desktop
You will need to type ".lnk" instead of ".desktop" if you are on Windows.
Metadata
Release files for desktop-file 1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| desktop_file-1.3.tar.gz | 5.5 kB | Without provenance | Details for desktop_file-1.3.tar.gz |
Release files / desktop_file-1.3.tar.gz
| Download URL | desktop_file-1.3.tar.gz |
|---|---|
| Size | 5.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
74b726ced06eb5fa7f567a5bff4ef9f9bb58e857f4f4f7f054082aaec76011f7
|
|
BLAKE2b-256 checksum How to use checksums |
4ffc036daafcaf63bea72148ba57b64de2e1d0355724e6e28458118d13c2dea5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.5
|
Security for desktop-file 1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.