Introduction
Portland is a joint OSDL/Freedesktop.org initiative to provide independent software developers (ISDs) with stable APIs into Desktop Linux and other Free Desktop platforms. The first result of the Portland initiative is Xdg-utils, a free set of open source tools that allows applications to easily integrate with the desktop configuration your customer has chosen to work with.
News
xdg-utils-1.1.0-rc1 is now available. (1 January 2011)
Xdg-utils
Xdg-utils is a set of command line tools that assist applications with a variety of desktop integration tasks. About half of the tools focus on tasks commonly required during the installation of a desktop application and the other half focuses on integration with the desktop environment while the application is running. Even if the desktop components of your application are limited to an installer, configuration or management tool, Xdg-utils provides you with an easy way to enhance the usage experience of your customers by improving the integration of these components in the user's environment. Best of all, Xdg-utils is provided as open source and free of charge.
Overview
Xdg-utils consists of the following installation related tools:
xdg-desktop-menu, install desktop menu items
xdg-desktop-icon, install icons to the desktop
xdg-icon-resource, install icon resources
xdg-mime, query information about file type handling and add descriptions for new file types
It also contains the following runtime integration tools:
xdg-open, open a file or URL in the user's preferred application
xdg-email, send mail using the user's preferred e-mail composer
xdg-screensaver, control the screensaver
License
Xdg-utils is licensed under the open source MIT license. See the License file for details.
Download
A complete version of Xdg-utils, including documentation and test suite is available as xdg-utils-1.0.2.tgz in the download area.
A stripped down version consisting only of the tools and their manual pages is available as xdg-utils-1.0.2-scripts.tgz This version is useful if you want to include the tools along with your application.
The stripped-down version is also available as a Zero Install feed, allowing your program to download it automatically if required.
Using Xdg-utils
Although we expect that these scripts will generally come as part of the operating system, we recommend that you package the scripts that your application needs along with your product as a fallback. For this purpose please obtain the original version of the xdg-utils from http://portland.freedesktop.org. The xdg-utils scripts that are distributed by operating systems vendors may have been tuned for their particular operating system and may not work on the same broad variety of operating systems as the original version.
We recommend that you place these scripts in a directory, and then add that directory to the end of the PATH. So, let's say that you're writing your post installation script, and you want to create a menu on any xdg-util compliant environment. Let's further assume that you've just installed to $INSTALL_DIR, and that your menu desktop file is in $INSTALL_DIR/mycompany-myapp.desktop. Finally, let's say that you've included the xdg-utils package in your installation in $INSTALL_DIR/xdg-utils.
- Then a simple post install script could look like this:
export PATH=$PATH:$INSTALL_DIR/xdg-utils/scripts xdg-desktop-menu install $INSTALL_DIR/mycompany-myapp.desktop
- And now your product has a menu on any XDG compliant desktop!
Note that we strongly recommend using this method - that is, putting your copy of the xdg-utils at the end of the path, and then invoking them without a specific path name.
That will allow your users and their system providers to use custom versions of the xdg-utils to adjust for system specific differences.
If you wish to absolutely force the issue and only use the versions you shipped, you could instead hard code the path to the version you bundle with your application. We strongly recommend against this, as it will make your product obsolete more quickly than is necessary.
Changelog
Changes in xdg-utils 1.1.0-rc:
Changes in xdg-utils 1.0.2:
- SVG icons are not supported but documentation still mentioned SVG
- xdg-email can now be used without any e-mail address
- Do not use mktemp without arguments, it breaks on systems with certain older versions of mktemp (xdg-desktop-menu, xdg-screensaver) [BR9266]
Changes in xdg-utils 1.0.1:
- Several shell syntax issues causing failures on Ubuntu 6.10
- Spurious output on stdout when running xdg-desktop-menu
- Non-ascii mailto URI handling of xdg-emial on non-UTF8 locales under KDE
Development
The development takes place in freedesktop.org GIT repository: http://cgit.freedesktop.org/xdg/xdg-utils/
Feedback and Questions
You can give feedback on the Portland project through the freedesktop.org bugreporting system or via the Portland mailinglist Please use the mailing list for any questions you may have.


