Class: Gio::DesktopAppInfo
- Inherits:
-
Object
- Object
- Gio::DesktopAppInfo
- Defined in:
- (unknown)
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 destkop 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) ⇒ TrueClass
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) ⇒ TrueClass
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.
-
#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) ⇒ TrueClass
Returns whether key exists in the “Desktop Entry” group of the keyfile backing info.
-
#is_hidden ⇒ TrueClass
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) ⇒ TrueClass
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) ⇒ TrueClass
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.
-
#new(desktop_id) ⇒ Gio::DesktopAppInfo
Creates a new GDesktop::AppInfo based on a desktop file id.
-
#new_from_filename(filename) ⇒ Gio::DesktopAppInfo
Creates a new GDesktop::AppInfo.
-
#new_from_keyfile(key_file) ⇒ Gio::DesktopAppInfo
Creates a new GDesktop::AppInfo.
-
#nodisplay ⇒ TrueClass
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.
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 destkop 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) ⇒ TrueClass
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) ⇒ TrueClass
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) ⇒ TrueClass
Returns whether key exists in the “Desktop Entry” group of the keyfile backing info.
#is_hidden ⇒ TrueClass
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) ⇒ TrueClass
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) ⇒ TrueClass
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.
#new(desktop_id) ⇒ Gio::DesktopAppInfo
Creates a new GDesktop::AppInfo based on a desktop file id.
A desktop file id is the basename of the desktop file, including the .desktop extension. GIO is looking for a desktop file with this name in the ‘applications` subdirectories of the XDG data directories (i.e. the directories specified in the `XDG_DATA_HOME` and `XDG_DATA_DIRS` environment variables). GIO also supports the prefix-to-subdirectory mapping that is described in the [Menu Spec](standards.freedesktop.org/menu-spec/latest/) (i.e. a desktop id of kde-foo.desktop will match `/usr/share/applications/kde/foo.desktop`).
#new_from_filename(filename) ⇒ Gio::DesktopAppInfo
Creates a new GDesktop::AppInfo.
#new_from_keyfile(key_file) ⇒ Gio::DesktopAppInfo
Creates a new GDesktop::AppInfo.
#nodisplay ⇒ TrueClass
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.