D-Bus#<
The first argument always needs to be the DBus signature tuple of the method call.
Next arguments must match the provided D-Bus signature.
If the D-Bus method does not accept any arguments, do not pass them.
-
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.
+
Example usage:
+
fromignis.optionsimportoptions
+
+# 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)
+
A simple service to set the wallpaper.
Supports multiple monitors.
+
There are options available for this service: Wallpaper.
Example usage:
..code-block::python
-fromignis.services.wallpaperimportWallpaperService
+fromignis.services.wallpaperimportWallpaperService
+fromignis.optionsimportoptions
-wallpaper=WallpaperService.get_default()
+WallpaperService.get_default()# just to initialize it
-wallpaper.set_wallpaper("path/to/image")
+options.wallpaper.set_wallpaper_path("path/to/image")
Window#Applying CSS styles directly to Widget.Window can cause various graphical glitches/bugs.
It's highly recommended to set some container (for example, Widget.Box) or widget as a child and apply styles to it.
For example:
-
The setupYou can pass a callback function to the widget costructor as the setup property.
The widget will be passed to the callback function as an argument.
This can be useful when you need to perform actions when the widget is initialized (for example, connect to signal).
-
fromignis.widgetsimportWidget
+
fromignis.widgetsimportWidgetWidget.Label(label="you will not see this text",
diff --git a/latest/dev/code_style.html b/latest/dev/code_style.html
index 94318dae..278e6e9d 100644
--- a/latest/dev/code_style.html
+++ b/latest/dev/code_style.html
@@ -30,7 +30,7 @@
-
+
diff --git a/latest/dev/creating_service.html b/latest/dev/creating_service.html
index c52078f9..2dd6c95d 100644
--- a/latest/dev/creating_service.html
+++ b/latest/dev/creating_service.html
@@ -30,7 +30,7 @@
-
+
@@ -454,23 +454,23 @@
_imports.pyIf the service requires additional imports from gi.repository,
which, in turn, requires installing dependencies by an user, define them here.
importgi
+importsys
+fromignis.exceptionsimportGvcNotFoundError# Gvc is here just for example.try:if"sphinx"notinsys.modules:# prevent possible errors while building docsgi.require_version("Gvc","1.0")
- fromgi.repositoryimportGvc# type: ignore
+ fromgi.repositoryimportGvc# type: ignoreexcept(ImportError,ValueError):
- raiseGvcNotFoundError()fromNone
+ raiseGvcNotFoundError()fromNone__all__=["Gvc"]
And then, import them ONLY from this file:
-
from._importsimportGvc
+
from._importsimportGvc# ... rest of code
@@ -480,10 +480,10 @@
service.pyPlace the service class itself in this file.
All services should inherit from the BaseService class.
Here is simple template for service.
-
fromignis.base_serviceimportBaseService
+
fromignis.base_serviceimportBaseService
-classExampleService(BaseService):
- def__init__(self):
+classExampleService(BaseService):
+ def__init__(self):super().__init__()# do other stuff here
fromgi.repositoryimportGtk,GObject
+fromignis.base_widgetimportBaseWidget
-classWIDGET_NAME(Gtk.WIDGET_NAME,BaseWidget):
+classWIDGET_NAME(Gtk.WIDGET_NAME,BaseWidget):__gtype_name__="IgnisWIDGET_NAME"__gproperties__={**BaseWidget.gproperties}# this need to inherit properties from BaseWidget
- def__init__(self,**kwargs):# accept keyword arguments
+ def__init__(self,**kwargs):# accept keyword argumentsGtk.Label.__init__(self)# if you want to override enums, do it BEFORE BaseWidget.__init__(self, **kwargs)# otherwise, the property will be set before it is overridden.
@@ -457,11 +457,11 @@