Icon Manager#
- class ignis.icon_manager.IconManager(*args: Any, **kwargs: Any)#
A simple class to add and remove custom icons.
- signal icons_added#
Emitted when a custom icons path has been added.
- Parameters:
path (
str
) -- The path to icons.
- signal icons_removed#
Emitted when a custom icons path has been removed.
- Parameters:
path (
str
) -- The path to icons.
- gproperty added_icons: list[str]#
read-only
The list of icon paths added via
add_icons()
.
- add_icons(path: str) None #
Add custom SVG icons from a directory.
The directory must contain
hicolor/scalable/actions
directory, icons must be insideactions
directory.For example, place icons inside the Ignis config directory:
~/.config/ignis ├── config.py ├── icons │ └── hicolor │ └── scalable │ └── actions │ ├── aaaa-symbolic.svg │ └── some-icon.svg
Note
To apply a CSS color to an icon, its name and filename must end with
-symbolic
.then, add this to your
config.py
:import os from ignis import utils from ignis.icon_manager import IconManager icon_manager = IconManager.get_default() icon_manager.add_icons(os.path.join(utils.get_current_dir(), "icons"))