package ocgtk

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Wrappers.Desktop_app_info

type t = [ `desktop_app_info | `object_ ] Gobject.obj
val new_ : string -> t

Create a new DesktopAppInfo

val new_from_filename : string -> t

Create a new DesktopAppInfo

val list_actions : t -> string array

Returns the list of "additional application actions" supported on the desktop file, as per the desktop file specification.

As per the specification, this is the list of actions that are explicitly listed in the "Actions" key of the Desktop Entry group.

val launch_action : t -> string -> [ `app_launch_context | `object_ ] Gobject.obj option -> unit

Activates the named application action.

You may only call this function on action names that were returned from g_desktop_app_info_list_actions().

Note that if the main entry of the desktop file indicates that the application supports startup notification, and @launch_context is non-%NULL, then startup notification will be used when activating the action (and as such, invocation of the action on the receiving side must signal the end of startup notification when it is completed). This is the expected behaviour of applications declaring additional actions, as per the desktop file specification.

As with g_app_info_launch() there is no way to detect failures that occur while using this function.

val has_key : t -> string -> bool

Returns whether @key exists in the "Desktop Entry" group of the keyfile backing @info.

val get_string_list : t -> string -> string array * Gsize.t

Looks up a string list value in the keyfile backing @info.

The @key is looked up in the "Desktop Entry" group.

val get_string : t -> string -> string option

Looks up a string value in the keyfile backing @info.

The @key is looked up in the "Desktop Entry" group.

val get_startup_wm_class : t -> string option

Retrieves the StartupWMClass field from @info. This represents the WM_CLASS property of the main window of the application, if launched through @info.

val get_show_in : t -> string option -> bool

Checks if the application info should be shown in menus that list available applications for a specific name of the desktop, based on the `OnlyShowIn` and `NotShowIn` keys.

@desktop_env should typically be given as %NULL, in which case the `XDG_CURRENT_DESKTOP` environment variable is consulted. If you want to override the default mechanism then you may specify @desktop_env, but this is not recommended.

Note that g_app_info_should_show() for @info will include this check (with %NULL for @desktop_env) as well as additional checks.

val get_nodisplay : t -> bool

Gets the value of the NoDisplay key, which helps determine if the application info should be shown in menus. See %G_KEY_FILE_DESKTOP_KEY_NO_DISPLAY and g_app_info_should_show().

val get_locale_string : t -> string -> string option

Looks up a localized string value in the keyfile backing @info translated to the current locale.

The @key is looked up in the "Desktop Entry" group.

val get_keywords : t -> string array

Gets the keywords from the desktop file.

val get_is_hidden : t -> bool

A desktop file is hidden if the Hidden key in it is set to True.

val get_generic_name : t -> string option

Gets the generic name from the desktop file.

val get_filename : t -> string option

When @info was created from a known filename, return it. In some situations such as the #GDesktopAppInfo returned from g_desktop_app_info_new_from_keyfile(), this function will return %NULL.

val get_categories : t -> string option

Gets the categories from the desktop file.

val get_boolean : t -> string -> bool

Looks up a boolean value in the keyfile backing @info.

The @key is looked up in the "Desktop Entry" group.

val get_action_name : t -> string -> string

Gets the user-visible display name of the "additional application action" specified by @action_name.

This corresponds to the "Name" key within the keyfile group for the action.