Functions

get_tmp_dir ()

pango_font_string_to_css (pango_font_string)

set_window_icon_from_file (window, file_name)

set_window_icon_name (window, icon_name)

set_window_progress (window, progress)

set_window_progress_pulse (window, pulse)

set_xid_icon_from_file (xid, file_name)

set_xid_icon_name (xid, icon_name)

set_xid_progress (xid, progress)

set_xid_progress_pulse (xid, pulse)

status_icon_interface_interface_info ()

status_icon_interface_override_properties (klass, property_id_begin)

switcheroo_control_interface_info ()

switcheroo_control_override_properties (klass, property_id_begin)

util_get_session_is_running ()

util_gpu_offload_supported ()

Details

XApp.get_tmp_dir()
Returns:

the directory to use for temporary files.

Return type:

str

Provides the path to the system’s temporary files folder. This is identical to GLib.get_tmp_dir, but includes the /dev/shm ramdisk as the first choice for a temporary folder.

New in version 2.2.16.

XApp.pango_font_string_to_css(pango_font_string)
Parameters:

pango_font_string (str) – a pango font description string

Returns:

the css compatible font string or None if the conversion failed.

Return type:

str

Converts a pango font description string to a string suitable for use with the css “font” tag. The font description must contain the font family and font size or conversion will fail and None will be returned

New in version 2.2.

XApp.set_window_icon_from_file(window, file_name)
Parameters:
Raises:

GLib.Error

Sets the icon name hint for a window manager (like muffin) to make available when applications want to change their icons during runtime without having to resort to the internal low-res pixbufs that Gdk.Window sets on the client side. This also chains up and calls Gtk.Window.set_icon_from_file for convenience and compatibility. Set to None to unset.

XApp.set_window_icon_name(window, icon_name)
Parameters:

Sets the icon name hint for a window manager (like muffin) to make available when applications want to change their icons during runtime without having to resort to the internal low-res pixbufs that Gdk.Window sets on the client side. This is a function, not a method, for taking advantage of this feature with descendants of GtkWindows, such as GtkDialogs. Sets Gtk.Window.set_icon_name as well, to avoid needing to have two calls each time. Set to None to unset.

XApp.set_window_progress(window, progress)
Parameters:

Sets the progress hint for a window manager (like muffin) to make available when applications want to display the application’s progress in some operation. The value sent to the WM will be clamped to between 0 and 100.

Note: If a window will stick around after progress is complete, you will probably need to set progress to 0 to remove any progress effects on taskbars and window lists.

Setting progress will also cancel the ‘pulsing’ flag on the window as well, if it has been set.

XApp.set_window_progress_pulse(window, pulse)
Parameters:

Sets the progress pulse hint hint for a window manager (like muffin) to make available when applications want to display indeterminate or ongoing progress in a task manager.

Note: If a window will stick around after progress is complete, you will probably need to set progress to 0 to remove any progress effects on taskbars and window lists. This will also remove the pulse state, if it is set.

Setting an explicit progress value will unset this flag.

XApp.set_xid_icon_from_file(xid, file_name)
Parameters:
  • xid (int) – The Window to set the icon name for

  • file_name (str or None) – The icon path to set, or None to unset.

Sets the icon name hint for a window manager (like muffin) to make available when applications want to change their icons during runtime without having to resort to the internal low-res pixbufs that Gdk.Window sets on the client side. This is a function, not a method, for applying the icon name property for a given (possibly foreign) window, by passing the window’s XID. Set to None to unset.

XApp.set_xid_icon_name(xid, icon_name)
Parameters:
  • xid (int) – The Window to set the icon name for

  • icon_name (str or None) – The icon name to set, or None to unset.

Sets the icon name hint for a window manager (like muffin) to make available when applications want to change their icons during runtime without having to resort to the internal low-res pixbufs that Gdk.Window sets on the client side. This is a function, not a method, for applying the icon name property for a given (possibly foreign) window, by passing the window’s XID. Set to None to unset.

XApp.set_xid_progress(xid, progress)
Parameters:
  • xid (int) – The Window to set the progress for

  • progress (int) – The value to set for progress.

Sets the progress hint for a window manager (like muffin) to make available when applications want to display the application’s progress in some operation. The value sent to the WM will be clamped to between 0 and 100.

Setting progress will also cancel the ‘pulsing’ flag on the window as well, if it has been set.

Note: If a window will stick around after progress is complete, you will probably need to set progress to 0 to remove any progress effects on taskbars and window lists.

This is a function, not a method, for applying the progress property for a given (possibly foreign) window, by passing the window’s XID.

XApp.set_xid_progress_pulse(xid, pulse)
Parameters:
  • xid (int) – The Window to set the progress for

  • pulse (bool) – Whether to have pulsing set or not.

Sets the progress pulse hint hint for a window manager (like muffin) to make available when applications want to display indeterminate or ongoing progress in a task manager.

Note: If a window will stick around after progress is complete, you will probably need to set progress to 0 to remove any progress effects on taskbars and window lists.

Setting an explicit progress value will unset this flag.

XApp.status_icon_interface_interface_info()
Returns:

A Gio.DBusInterfaceInfo. Do not free.

Return type:

Gio.DBusInterfaceInfo

Gets a machine-readable description of the ‘org.x.StatusIcon [gdbus-interface-org-x-StatusIcon.top_of_page]’ D-Bus interface.

XApp.status_icon_interface_override_properties(klass, property_id_begin)
Parameters:
Returns:

The last property id.

Return type:

int

Overrides all GObject.Object properties in the XApp.StatusIconInterface interface for a concrete class. The properties are overridden in the order they are defined.

XApp.switcheroo_control_interface_info()
Returns:

A Gio.DBusInterfaceInfo. Do not free.

Return type:

Gio.DBusInterfaceInfo

Gets a machine-readable description of the ‘net.hadess.SwitcherooControl [gdbus-interface-net-hadess-SwitcherooControl.top_of_page]’ D-Bus interface.

XApp.switcheroo_control_override_properties(klass, property_id_begin)
Parameters:
Returns:

The last property id.

Return type:

int

Overrides all GObject.Object properties in the XApp.SwitcherooControl interface for a concrete class. The properties are overridden in the order they are defined.

XApp.util_get_session_is_running()
Returns:

True if the session is running.

Return type:

bool

Check if the Session Manager is currently in the “Running” phase.

New in version 2.0.

XApp.util_gpu_offload_supported()
Returns:

True if supported.

Return type:

bool

Performs a check to see if on-demand mode for discrete graphics is supported.

New in version 1.8.