Options#

class ignis.options.Options(*args, **kwargs)#

Options for Ignis.

Warning

Use already initialized instance of this class:

from ignis.options import options

print(options.notifications.dnd)

Below are classes with options, their names begin with a capital letter. However, if you want to get the current value of an option or set a value, use an initialized instance that starts with a lowercase letter.

For example:
  • Notifications -> notifications

  • Recorder -> recorder

  • and etc.

You can use classes (not instances of them) to obtain default values of options.

Hint

If the option is of type TrackedList, it means that it is regular Python list. But you can call .append(), .remove(), .insert(), etc., and the changes will be applied!

The options file is located at ignis.DATA_DIR/options.json ($XDG_DATA_HOME/ignis/options.json).

Example usage:

from ignis.options import options

# Get an option value
print(options.notifications.dnd)

# Set a new value for an option
options.notifications.dnd = True

# Connect to an option change event
options.notifications.connect_option("dnd", lambda: print("option dnd changed! new value:", options.notifications.dnd))

# You can also bind to an option!
options.notifications.bind("dnd")

# Obtain the default value of an option
print(options.Notifications.popup_timeout)
class Notifications(*args, **kwargs)#

Options for the NotificationService.

dnd: bool = False#

Do Not Disturb mode.

If set to True, the new_popup signal will not be emitted, and all new Notification instances will have popup set to False.

popup_timeout: int = 5000#

The timeout before a popup is automatically dismissed, in milliseconds.

max_popups_count: int = 3#

The maximum number of popups.

If the length of the popups list exceeds max_popups_count, the oldest popup will be dismissed.

class Recorder(*args, **kwargs)#

Options for the RecorderService.

This mainly includes the default recorder configuration options. For more detailed information, see RecorderConfig.

bitrate: int = 8000#

The bitrate of the recording.

Deprecated since version 0.6: This option is deprecated and no longer has any effect.

default_file_location: str | None = 'XDG Videos directory'#

The default location for saving recordings. Defaults to XDG Video directory. Has effect only if default_path is not overridden.

default_filename: str = '%Y-%m-%d_%H-%M-%S.mp4'#

The default filename for recordings. Supports time formating. Has effect only if default_path is not overridden.

default_source: Literal['screen', 'screen-direct', 'focused', 'portal', 'region'] | str = 'portal'#

The default recording source.

default_path: str = 'XDG Videos directory/%Y-%m-%d_%H-%M-%S.mp4'#

The default output file path. By default equals to default_file_location / default_filename.

default_resolution_limit: str | None = None#

The default resolution limit.

default_region: str | None = None#

The default region to capture.

default_framerate: int | None = None#

The default framerate.

default_audio_devices: list[str] | None = None#

The default audio devices.

default_quality: Literal['medium', 'high', 'very_high', 'ultra'] | None = None#

The default quality.

default_video_codec: Literal['auto', 'h264', 'hevc', 'av1', 'vp8', 'vp9', 'hevc_hdr', 'av1_hdr', 'hevc_10bit', 'av1_10bit'] | None = None#

The default video codec.

default_audio_codec: Literal['aac', 'opus', 'flac'] | None = None#

The default audio codec.

default_audio_bitrate: int | None = None#

The default audio bitrate.

default_framerate_mode: Literal['cfr', 'vfr', 'content'] | None = None#

The default framerate mode.

default_bitrate_mode: Literal['auto', 'qp', 'vbr', 'cbr'] | None = None#

The default bitrate mode.

default_color_range: Literal['limited', 'full'] | None = None#

The default color range.

default_cursor: Literal['yes', 'no'] | None = None#

Whether to record cursor by default.

default_encoder: Literal['gpu', 'cpu'] | None = None#

The default encoder.

default_format_time: bool = True#

Whether to format the time by default.

default_extra_args: dict[str, str] = {}#

The default extra arguments to pass to gpu-screen-recorder.

class Applications(*args, **kwargs)#

Options for the ApplicationsService.

pinned_apps: TrackedList[str] = []#

A list of the pinned applications desktop files, e.g. "firefox.desktop", "code.desktop".

class Wallpaper(*args, **kwargs)#

Options for the WallpaperService.

wallpaper_path: str | None = None#

The path to the wallpaper image.