Application#

class ignis.app.IgnisApp(*args: Any, **kwargs: Any)#

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_default()
Signals:
  • "ready" (): Emitted when the configuration has been parsed.

  • "quit" (): Emitted when Ignis has finished running.

Properties:
  • windows (list[Gtk.Window], read-only): List of windows.

  • is_ready (bool, read-only): Whether configuration is parsed and app is ready.

  • autoreload_config (bool, read-write, default: True): Whether to automatically reload the configuration when it changes (only .py files).

  • autoreload_css (bool, read-write, default: True): Whether to automatically reload the CSS style when it changes (only .css/.scss/.sass files).

classmethod get_default() IgnisApp#

Get the default Application object for this process.

apply_css(style_path: str) None#

Apply a CSS/SCSS/SASS style from a path. If style_path has a .sass or .scss extension, it will be automatically compiled. Requires dart-sass for SASS/SCSS compilation.

Parameters:

style_path (str) -- Path to the .css/.scss/.sass file.

Raises:
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:
reset_css() None#

Reset all applied CSS/SCSS/SASS styles.

Raises:

DisplayNotFoundError --

reload_css() None#

Reload all applied CSS/SCSS/SASS styles.

Raises:

DisplayNotFoundError --

get_window(window_name: str) gi.repository.Gtk.Window#

Get a window by name.

Parameters:

window_name (str) -- The window's namespace.

Returns:

The window object.

Return type:

Gtk.Window

Raises:

WindowNotFoundError -- If a window with the given namespace does not exist.

open_window(window_name: str) None#

Open (show) a window by its name.

Parameters:

window_name (str) -- The window's namespace.

Raises:

WindowNotFoundError -- If a window with the given namespace does not exist.

close_window(window_name: str) None#

Close (hide) a window by its name.

Parameters:

window_name (str) -- The window's namespace.

Raises:

WindowNotFoundError -- If a window with the given namespace does not exist.

toggle_window(window_name: str) None#

Toggle (change visibility to opposite state) a window by its name.

Parameters:

window_name (str) -- The window's namespace.

Raises:

WindowNotFoundError -- If a window with the given namespace does not exist.

add_window(window_name: str, window: gi.repository.Gtk.Window) None#

Add a window. You typically shouldn't use this method, as windows are added to the app automatically.

Parameters:
  • window_name (str) -- The window's namespace.

  • window (Gtk.Window) -- The window instance.

Raises:

WindowAddedError -- If a window with the given namespace already exists.

remove_window(window_name: str) None#

Remove a window by its name. The window will be removed from the application.

Parameters:

window_name (str) -- The window's namespace.

Raises:

WindowNotFoundError -- If a window with the given namespace does not exist.

reload() None#

Reload Ignis.

quit() None#

Quit Ignis.

inspector() None#

Open GTK Inspector.