-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit fa6e9b4
Showing
274 changed files
with
43,731 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Sphinx build info version 1 | ||
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. | ||
config: 8e492319c245cbc4f605c899814aa655 | ||
tags: 645f666f9bcd5a90fca523b33c5a78b7 |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Application | ||
------------- | ||
|
||
.. autoclass:: ignis.app.IgnisApp | ||
:members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
Dynamic content | ||
================ | ||
|
||
Signals | ||
------------ | ||
In GObject, we have a concept called "signals". | ||
|
||
Signals are system for registering callbacks for specific events. | ||
For example, when a user clicks a button, the program can perform a specific action. | ||
Similarly, when a property of an object changes, the program can respond accordingly. | ||
|
||
To connect to signals, use ``.connect()`` method on GObject that has the signal you need. | ||
Pass a callback function that will be called when the signal is emitted. | ||
Signals always pass the GObject they belong to as the first argument to the callback. | ||
Services also have their own signals, which are listed on their respective documentation pages. | ||
Additionally, signals can have custom arguments. | ||
In example below, ``"player_added"`` signal passes an instance of :class:`~ignis.services.mpris.MprisPlayer` as the second argument to the callback. | ||
|
||
Here, we will use the :class:`~ignis.services.mpris.MprisService` as an example. | ||
|
||
.. code-block:: python | ||
from ignis.service import Service | ||
mpris = Service.get("mpris") | ||
mpris.connect("player_added", lambda x, player: print(player.desktop_entry, player.title)) | ||
Now, try opening any media player (for example, video on youtube or music in spotify). | ||
Magic! The player name and title will be printed. | ||
|
||
To emit (call) signal manually, use the ``.emit()`` method and pass the signal name to it. | ||
|
||
``notify`` signal | ||
------------------ | ||
The ``notify`` is a special signal that emits when a property changes. | ||
To connect to it, use the following syntax: ``"notify::PROPERTY-NAME"``. | ||
|
||
.. danger:: | ||
|
||
Use ``-`` instead of ``_``. Otherwise, signal callback will never be called. | ||
|
||
.. code-block:: python | ||
mpris.connect("notify::players", lambda x, y: print(x.players)) | ||
Binding | ||
--------------- | ||
|
||
You can call the ``.bind()`` method on widgets, services, or utils and pass a property name. | ||
This method returns a :class:`~ignis.gobject.Binding`, which you can use to set a property value for a widget. | ||
|
||
.. code-block:: python | ||
from ignis.services import Service | ||
from ignis.widgets import Widget | ||
audio = Service.get("audio") | ||
Widget.Label(label=audio.speaker.bind("volume", transform=lambda value: str(value))) | ||
This code creates a binding. | ||
Now, the label of ``Widget.Label`` will depend on the speaker's volume. | ||
The ``label`` property accepts a ``str``, but ``speaker.volume`` is an ``int``. | ||
So, we provide a transform function to ``.bind()``, | ||
which converts the speaker volume to a string. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
Getting started | ||
=============== | ||
|
||
First widgets | ||
----------------- | ||
|
||
First of all, let's create a config file in the default location. | ||
The default config file is located at ``~/.config/ignis/config.py``. | ||
You can create it using your file manager or the terminal with the command below. | ||
|
||
.. code-block:: bash | ||
touch ~/.config/ignis/config.py | ||
Open this file with your code editor. | ||
|
||
Now, let's create the first window and display some text on it. | ||
|
||
.. code-block:: python | ||
from ignis.widgets import Widget | ||
Widget.Window( | ||
namespace="some-window", | ||
child=Widget.Label( | ||
label="Hello world!" | ||
), | ||
) | ||
A list of all parameters is provided here: :class:`~ignis.widgets.Widget.Window`. | ||
Feel free to experiment with them. | ||
|
||
In this example, we used the ``Widget`` class, which provides access to all other widgets. | ||
|
||
What is widget? | ||
------------------ | ||
Widget - is a graphical component, an element we see on screen. Buttons, text, switches, icons, sliders, etc. | ||
|
||
A window is a top-level widget that contains all other widgets. | ||
|
||
Some common widgets | ||
--------------------- | ||
|
||
:class:`~ignis.widgets.Widget.Label` | ||
-------------------------------------- | ||
A widget that displays text. | ||
|
||
.. code-block:: python | ||
Widget.Label(label="some text") | ||
:class:`~ignis.widgets.Widget.Box` | ||
----------------------------------- | ||
A layout container that can contain multiple child widgets and arrange them either vertically or horizontally. | ||
By default, it places children horizontally. To place them vertically, set ``vertical`` to ``True``. | ||
|
||
.. code-block:: python | ||
Widget.Box( | ||
vertical=False, # or True | ||
spacing=10, | ||
child=[Widget.Label(label="first label"), Widget.Label(label="second label")] | ||
) | ||
:class:`~ignis.widgets.Widget.Button` | ||
----------------------------------------- | ||
I think from the name it's clear what kind of widget this is. | ||
You can set a label for the button or use a custom child. | ||
|
||
.. code-block:: python | ||
Widget.Button( | ||
label="click me", | ||
on_click=lambda x: print("clicked!") | ||
) | ||
.. code-block:: python | ||
Widget.Button( | ||
child=Widget.Label(label="test"), | ||
on_click=lambda x: print("clicked22!") | ||
) | ||
:class:`~ignis.widgets.Widget.Icon` | ||
----------------------------------------- | ||
In GTK, there are built-in icons that you can access by name, so you probably won't need icons from nerd fonts. | ||
To find out the names of the icons, you can use ``gtk4-icon-browser`` (you need to install ``gtk4-demos`` package). | ||
|
||
.. code-block:: python | ||
Widget.Icon( | ||
image="audio-volume-high-symbolic" | ||
) | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
GObject | ||
------------- | ||
|
||
.. autoclass:: ignis.gobject.IgnisGObject | ||
:members: | ||
|
||
.. autoclass:: ignis.gobject.Binding | ||
:members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Ignis | ||
=============================== | ||
Full-featured Python framework for building desktop shells using GTK4. | ||
|
||
Documentation | ||
------------- | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
installation | ||
getting_started | ||
styling | ||
properties | ||
dynamic_content | ||
gobject | ||
app | ||
widgets/index | ||
services/index | ||
utils/index |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
Installation | ||
============ | ||
|
||
Arch linux | ||
----------- | ||
|
||
.. code-block:: bash | ||
paru -S ignis | ||
Building from source | ||
--------------------- | ||
|
||
**Dependencies:** | ||
|
||
- git | ||
- ninja | ||
- meson | ||
- gtk4 | ||
- gtk4-layer-shell | ||
- pygobject | ||
- pycairo | ||
|
||
.. code-block:: bash | ||
git clone https://github.com/linkfrg/ignis.git | ||
cd ignis | ||
meson setup build | ||
meson compile -C build | ||
meson install -C build | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
Properties | ||
=============== | ||
|
||
Most classes in Ignis have properties. | ||
These properties can have specific types (int, str, float), can be read-write or read-only, and can be optional or mandatory. | ||
|
||
In PyGObject, you typically use the special props attribute to access GObject properties. | ||
However, in Ignis, you don't need to use this attribute. | ||
Instead, you can access GObject properties using the standard Python approach. | ||
|
||
.. code-block:: python | ||
widget = Widget.Label(label="Hello world!") | ||
print(widget.label) # prints: "Hello world!" | ||
To set a property, you can use the assignment operator ``=`` or a method that starts with ``set_``. | ||
|
||
.. code-block:: python | ||
widget.label = "test" | ||
print(widget.label) # prints: "test" | ||
widget.set_label("ignis") # this also works | ||
print(widget.label) # prints: "ignis" | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Applications | ||
------------ | ||
|
||
.. automodule:: ignis.services.applications | ||
:members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Audio | ||
----- | ||
|
||
.. automodule:: ignis.services.audio | ||
:members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Fetch | ||
----- | ||
|
||
.. automodule:: ignis.services.fetch | ||
:members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Hyprland | ||
-------- | ||
|
||
.. automodule:: ignis.services.hyprland | ||
:members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Mpris | ||
----- | ||
|
||
.. automodule:: ignis.services.mpris | ||
:members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Network | ||
------- | ||
|
||
.. automodule:: ignis.services.network | ||
:members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Notifications | ||
------------- | ||
|
||
.. automodule:: ignis.services.notifications | ||
:members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Options | ||
------- | ||
|
||
.. automodule:: ignis.services.options | ||
:members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Recorder | ||
-------- | ||
|
||
.. automodule:: ignis.services.recorder | ||
:members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Systemtray | ||
----------- | ||
|
||
.. automodule:: ignis.services.system_tray | ||
:members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Wallpaper | ||
--------- | ||
|
||
.. automodule:: ignis.services.wallpaper | ||
:members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
Services | ||
========== | ||
There is a list of built-in services that provide additional functionality to build various components of your desktop. | ||
|
||
To access a service, use the universal ``Service`` class: | ||
|
||
.. code-block:: python | ||
from ignis.services import Service | ||
service_name = Service.get("service_name") | ||
.. warning:: | ||
You don't need to initialize services manually. They will be automatically initialized when imported. | ||
|
||
.. danger:: | ||
Some services have additional dependencies, which are listed on the service page. | ||
Without these dependencies, the service will crash Ignis when you try to import it. | ||
|
||
.. toctree:: | ||
:glob: | ||
:maxdepth: 1 | ||
|
||
generated/* |
Oops, something went wrong.