Application#
- class ignis.app.IgnisApp(*args: Any, **kwargs: Any)#
Bases:
Gtk.Application.The application class.
Danger
Do not initialize this class! Instead, use the already initialized instance as shown below.
from ignis.app import IgnisApp app = IgnisApp.get_initialized()
- gproperty reload_on_monitors_change: bool#
read-write
Whether to reload Ignis on monitors change (connect/disconnect).
Default:
True.
- classmethod get_initialized() IgnisApp#
Guaranteed to return the default instance of the application for this process. If the application is not initialized, raises
AppNotInitializedError.- Raises:
AppNotInitializedError -- If the application is not initialized yet.
TypeError -- If the default application is not an instance of
IgnisApp.
- Return type:
- signal ready#
Emitted when the configuration has been parsed.
Hint
To handle shutdown of the application use the
shutdownsignal.Deprecated since version 0.6: Use
ignis.config_manager.ConfigManager.config_parsedinstead.
- gproperty is_ready: bool#
read-only
Whether configuration is parsed and app is ready.
Deprecated since version 0.6: Use
ignis.config_manager.ConfigManager.is_config_parsedinstead.
- gproperty windows: list[gi.repository.Gtk.Window]#
read-only
Deprecated since version 0.6: Use
windowsinstead.
- gproperty autoreload_config: bool#
read-write
Whether to automatically reload the configuration when it changes (only .py files).
Default:
True.Deprecated since version 0.6: Use
ignis.config_manager.ConfigManager.autoreload_configinstead.
- gproperty autoreload_css: bool#
read-write
Whether to automatically reload the CSS style when it changes (only .css/.scss/.sass files).
Default:
True.Deprecated since version 0.6: Use
ignis.css_manager.CssInfoPath.autoreloadinstead.
- gproperty widgets_style_priority: Literal['application', 'fallback', 'settings', 'theme', 'user']#
read-write
The priority used for each widget style unless a widget specifies a custom style priority using
style_priority. More info about style priorities:Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION.Default:
"application".Warning
Changing this property won't affect already initialized widgets! If you want to set a custom global style priority for all widgets, do this at the start of the configuration.
from ignis.app import IgnisApp app = IgnisApp.get_default() app.widgets_style_priority = "user" # ... rest of config goes here
Deprecated since version 0.6: Use
ignis.css_manager.CssManager.widgets_style_priorityinstead.
- classmethod get_default(cls: type[IgnisApp]) IgnisApp#
Get the default Application object for this process. :rtype:
IgnisAppDeprecated since version This: function initializes the application if it hasn't been done already, which is not the intended behavior. Use
get_initialized()instead.
- add_icons(path: str) None#
- Return type:
Deprecated since version 0.6: Use
ignis.icon_manager.IconManager.add_icons()instead.
- apply_css(style_path: str, style_priority: Literal['application', 'fallback', 'settings', 'theme', 'user'] = 'application', compiler: Literal['sass', 'grass'] | None = None) None#
Apply a CSS/SCSS/SASS style from a path. If
style_pathhas a.sassor.scssextension, it will be automatically compiled. Requires eitherdart-sassorgrass-sassfor SASS/SCSS compilation.- Parameters:
style_path (
str) -- Path to the .css/.scss/.sass file.style_priority (
Literal['application','fallback','settings','theme','user'], default:'application') -- A priority of the CSS style. More info about style priorities:Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION.compiler (
Literal['sass','grass'] |None, default:None) -- The desired Sass compiler.
- Return type:
Warning
style_prioritywon't affect a style applied to widgets using thestyleproperty, for these purposes usewidgets_style_priorityorignis.base_widget.BaseWidget.style_priority.- Raises:
StylePathAppliedError -- if the given style path is already to the application.
CssParsingError -- If an error occured while parsing the CSS/SCSS file. NOTE: If you compile a SASS/SCSS file, it will print the wrong section.
Deprecated since version 0.6: Use
ignis.css_manager.CssManager.apply_css()instead.
- remove_css(style_path: str) None#
Remove the applied CSS/SCSS/SASS style by its path.
- Parameters:
style_path (
str) -- Path to the applied .css/.scss/.sass file.- Raises:
StylePathNotFoundError -- if the given style path is not applied to the application.
- Return type:
Deprecated since version 0.6: Use
ignis.css_manager.CssManager.remove_css()instead.
- reset_css() None#
Reset all applied CSS/SCSS/SASS styles.
- Raises:
- Return type:
Deprecated since version 0.6: Use
ignis.css_manager.CssManager.reset_css()instead.
- reload_css() None#
Reload all applied CSS/SCSS/SASS styles.
- Raises:
- Return type:
Deprecated since version 0.6: Use
ignis.css_manager.CssManager.reload_css()orignis.css_manager.CssManager.reload_all_css()instead.
- get_window(window_name: str) gi.repository.Gtk.Window#
- Return type:
Window
Deprecated since version 0.6: Use
get_window()instead.
- open_window(window_name: str) None#
- Return type:
Deprecated since version 0.6: Use
open_window()instead.
- close_window(window_name: str) None#
- Return type:
Deprecated since version 0.6: Use
close_window()instead.
- toggle_window(window_name: str) None#
- Return type:
Deprecated since version 0.6: Use
toggle_window()instead.
- add_window(window_name: str, window: gi.repository.Gtk.Window) None#
- Return type:
Deprecated since version 0.6: Use
add_window()instead.
- remove_window(window_name: str) None#
- Return type:
Deprecated since version 0.6: Use
remove_window()instead.
- inspector() None#
Open GTK Inspector. :rtype:
NoneDeprecated since version 0.6: Use
ignis.utils.open_inspector()instead.