LinuxCommandLibrary

gtk-launch

Launch a graphical application by its name

TLDR

Launch an application

$ gtk-launch [Application_name]
copy

Display help
$ gtk-launch [[-h|--help]]
copy

SYNOPSIS

gtk-launch [application-name]

PARAMETERS

[application-name]
    The name of the application to launch, as specified in its .desktop file's 'Name' key. This argument is mandatory.

DESCRIPTION

gtk-launch allows you to launch applications registered in the system based on their desktop entry name. It searches the standard application directories (defined by the XDG Base Directory Specification) for .desktop files. Instead of providing the full path to an executable, you simply provide the name of the application as defined in its .desktop file (the 'Name' key). This is particularly useful for launching applications via scripting or from the command line when the exact path to the executable is unknown or may vary between systems. gtk-launch simplifies application launching and allows for a more consistent and user-friendly experience, especially in environments with graphical interfaces like GNOME, XFCE or KDE.

CAVEATS

The application must have a correctly formatted .desktop file and be registered in one of the standard application directories. If multiple .desktop files share the same 'Name', the behavior is undefined. The command relies on the desktop environment and may behave differently, or not at all, outside of a standard desktop environment.

APPLICATION NAMING

The 'application-name' should match the value of the Name key in the corresponding .desktop file. Use lowercase or partial names is supported but not required. If the name is ambiguous, gtk-launch may pick an unexpected application.

DESKTOP ENTRY FILES

.desktop files are used to describe how applications should be launched. They contain information such as the application's name, icon, command line, and categories.
These files are stored in directories like /usr/share/applications/ and ~/.local/share/applications/.

HISTORY

gtk-launch was originally developed as part of the GTK+ toolkit and the broader GNOME ecosystem. It provides a convenient command-line interface to application launching based on desktop entry files. Its creation facilitated a more streamlined approach to application management and provided a standardized way to launch GUI programs. Over time, it has become a standard tool across several Linux distributions.

SEE ALSO

Copied to clipboard