Class: Gio::DesktopAppInfo
- Inherits:
-
Object
- Object
- Gio::DesktopAppInfo
- Defined in:
- (unknown)
Class Method Summary collapse
-
.desktop_env=(desktop_env) ⇒ nil
Sets the name of the desktop that the application is running in.
-
.get_implementations(interface) ⇒ GLib::List<Gio::DesktopAppInfo>
Gets all applications that implement interface.
Instance Method Summary collapse
-
#categories ⇒ String
Gets the categories from the desktop file.
-
#filename ⇒ String
The origin filename of this GDesktop::AppInfo.
-
#filename=(filename) ⇒ String
The origin filename of this GDesktop::AppInfo.
-
#generic_name ⇒ String
Gets the generic name from the desktop file.
-
#get_action_name(action_name) ⇒ String
Gets the user-visible display name of the "additional application action" specified by action_name.
-
#get_boolean(key) ⇒ Boolean
Looks up a boolean value in the keyfile backing info.
-
#get_locale_string(key) ⇒ String
Looks up a localized string value in the keyfile backing info translated to the current locale.
-
#get_show_in(desktop_env) ⇒ Boolean
Checks if the application info should be shown in menus that list available applications for a specific name of the desktop, based on the
OnlyShowInandNotShowInkeys. -
#get_string(key) ⇒ String
Looks up a string value in the keyfile backing info.
-
#get_string_list(key, length) ⇒ Array<String>
Looks up a string list value in the keyfile backing info.
-
#has_key(key) ⇒ Boolean
Returns whether key exists in the "Desktop Entry" group of the keyfile backing info.
-
#initialize(key_file) ⇒ Gio::DesktopAppInfo
constructor
Creates a new GDesktop::AppInfo.
-
#is_hidden ⇒ Boolean
A desktop file is hidden if the Hidden key in it is set to True.
-
#keywords ⇒ Array<String>
Gets the keywords from the desktop file.
-
#launch_action(action_name, launch_context) ⇒ nil
Activates the named application action.
-
#launch_uris_as_manager(uris, launch_context, spawn_flags, user_setup, user_setup_data, pid_callback, pid_callback_data) ⇒ Boolean
This function performs the equivalent of g_app_info_launch_uris(), but is intended primarily for operating system components that launch applications.
-
#launch_uris_as_manager_with_fds(uris, launch_context, spawn_flags, user_setup, user_setup_data, pid_callback, pid_callback_data, stdin_fd, stdout_fd, stderr_fd) ⇒ Boolean
Equivalent to g_desktop_app_info_launch_uris_as_manager() but allows you to pass in file descriptors for the stdin, stdout and stderr streams of the launched process.
-
#list_actions ⇒ Array<String>
Returns the list of "additional application actions" supported on the desktop file, as per the desktop file specification.
-
#nodisplay ⇒ Boolean
Gets the value of the NoDisplay key, which helps determine if the application info should be shown in menus.
-
#startup_wm_class ⇒ String
Retrieves the StartupWMClass field from info.
Constructor Details
#initialize(key_file) ⇒ Gio::DesktopAppInfo
Creates a new GDesktop::AppInfo.
Class Method Details
.desktop_env=(desktop_env) ⇒ nil
Sets the name of the desktop that the application is running in.
This is used by g_app_info_should_show() and
g_desktop_app_info_get_show_in() to evaluate the
OnlyShowIn and NotShowIn
desktop entry fields.
Should be called only once; subsequent calls are ignored.
.get_implementations(interface) ⇒ GLib::List<Gio::DesktopAppInfo>
Gets all applications that implement interface.
An application implements an interface if that interface is listed in the Implements= line of the desktop file of the application. objects.
Instance Method Details
#categories ⇒ String
Gets the categories from the desktop file.
#filename ⇒ String
The origin filename of this GDesktop::AppInfo
#filename=(filename) ⇒ String
The origin filename of this GDesktop::AppInfo
#generic_name ⇒ String
Gets the generic name from the desktop file.
#get_action_name(action_name) ⇒ 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.
#get_boolean(key) ⇒ Boolean
Looks up a boolean value in the keyfile backing info.
The key is looked up in the "Desktop Entry" group.
#get_locale_string(key) ⇒ String
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.
#get_show_in(desktop_env) ⇒ Boolean
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 nil, 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
nil for desktop_env) as well as additional checks.
OnlyShowIn and NotShowIn keys, false
otherwise.
#get_string(key) ⇒ String
Looks up a string value in the keyfile backing info.
The key is looked up in the "Desktop Entry" group.
#get_string_list(key, length) ⇒ Array<String>
Looks up a string list value in the keyfile backing info.
The key is looked up in the "Desktop Entry" group.
#has_key(key) ⇒ Boolean
Returns whether key exists in the "Desktop Entry" group of the keyfile backing info.
#is_hidden ⇒ Boolean
A desktop file is hidden if the Hidden key in it is set to True.
#keywords ⇒ Array<String>
Gets the keywords from the desktop file.
#launch_action(action_name, launch_context) ⇒ nil
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-nil, 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.
#launch_uris_as_manager(uris, launch_context, spawn_flags, user_setup, user_setup_data, pid_callback, pid_callback_data) ⇒ Boolean
This function performs the equivalent of g_app_info_launch_uris(), but is intended primarily for operating system components that launch applications. Ordinary applications should use g_app_info_launch_uris().
If the application is launched via GSpawn, then spawn_flags, user_setup and user_setup_data are used for the call to g_spawn_async(). Additionally, pid_callback (with pid_callback_data) will be called to inform about the PID of the created process. See g_spawn_async_with_pipes() for information on certain parameter conditions that can enable an optimized posix_spawn() codepath to be used.
If application launching occurs via some other mechanism (eg: D-Bus activation) then spawn_flags, user_setup, user_setup_data, pid_callback and pid_callback_data are ignored.
#launch_uris_as_manager_with_fds(uris, launch_context, spawn_flags, user_setup, user_setup_data, pid_callback, pid_callback_data, stdin_fd, stdout_fd, stderr_fd) ⇒ Boolean
Equivalent to g_desktop_app_info_launch_uris_as_manager() but allows you to pass in file descriptors for the stdin, stdout and stderr streams of the launched process.
If application launching occurs via some non-spawn mechanism (e.g. D-Bus activation) then stdin_fd, stdout_fd and stderr_fd are ignored.
#list_actions ⇒ Array<String>
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.
#nodisplay ⇒ Boolean
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().
#startup_wm_class ⇒ String
Retrieves the StartupWMClass field from info. This represents the WM_CLASS property of the main window of the application, if launched through info. in the desktop file.