This page lists tips many common tasks when developing applications for different platforms

Windows

Coming soon!

macOS

Coming soon!

Freedesktop

Installing files in standard directories

On Unix-based systems, it's really important to make sure you're following the Filesystem hierarchy standard and XDG base directory specifications. You can use the XDG basedir submodule for an easy way to get the correct directories.

Desktop files

When developing an application for freedesktop-based systems, you need a .desktop file for it. This file lists metadata, that controls the following:

  1. Whether the application can be seen in the menus
  2. What file types the application can open
  3. Name of the application in multiple languages
  4. And more

Here is an example desktop file, which details everything about it. After being installed to /usr/share/applications/ the application will appear in the menus and application search in the desktop.

[Desktop Entry]
Type=Application
Version=1.0
Name=UntitledDesktop Session Logout
GenericName=SessionLogout
Comment=Allows the user to log out, power off, restart and put the computer to sleep using a GUI
Icon=ude-session-logout
TryExec=ude-session-logout
Exec=ude-session-logout
Categories=System;Utility;
Terminal=false
StartupNotify=false

More information on the Freedesktop desktop entry specification.

Interacting with the desktop environment

Many applications may need to interact with the desktop environment as part of their feature set. On Freedesktop systems most interactions between applications go through standardised DBus interfaces. You can enable the dbus submodule to easily communicate over the bus in a type- and memory-safe manner.

There are many standard interfaces, however there are 2 main types:

  1. Normal interfaces
  2. XDG desktop portals

Normal interfaces and XDG desktop portal interfaces can be very similar, however there are a few differences. For starters, XDG desktop portals were created for applications that were are containerised in environments like Flatpak or Snaps. They may provide better security features, or may be updated more frequently compared to normal interfaces. On the other hand, they may lack many features that might be a security concern in containerised workflows.

A list of XDG desktop portal interfaces can be found here.

A list of normal standardised DBus interfaces can be found here, though they are mixed with other XDG standards.