Skip to main content

desktop-file is a tool to create desktop shortcuts for windows and linux.

Project description

Desktop File


desktop-file is a tool to create desktop shortcuts for windows and linux.


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 install



You can use it in your python script like this:

>>> import desktop_file
>>> # get desktop and start menu folders
>>> desktop_file.getDesktopPath()
>>> desktop_file.getMenuPath()
>>> # create a xterm shortcut
>>> shortcut = desktop_file.Shortcut("/home/PyRectangle/Desktop", "XTerm", "/usr/bin/xterm")
>>> shortcut.setWorkingDirectory("/home/PyRectangle")
>>> shortcut.setComment("A desktop file to start xterm")
>>> # Only ".ico" files work on Windows
>>> shortcut.setIcon("/usr/share/pixmaps/mini.xterm_48x48.xpm")
>>> # Categories don't have any effects on Windows
>>> shortcut.setCategories("System;")

You will find a working shortcut named "XTerm" in the folder "/home/PyRectangle/Desktop"


You can use python -m desktop_file or desktop-file to create shortcuts like this:

desktop-file --exec /usr/bin/xterm --workpath /home/PyRectangle --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.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

desktop_file-1.0.tar.gz (4.3 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page