Thank you for considering contributing. Feel free to get in touch.
- Install Workbench from Flathub
- Go through the Welcome Library entry
If you're completely new to GNOME development this is for you.
Open the "Welcome" example from Workbench Library.
Important fundamentals are
- objects
- properties
- signals
Every widget in GTK is an object. For example, Gtk.Box
, Gtk.Button
, ...
Properties affect an object to change its appearance or behavior.
Signals are events that can be listened to. Like clicked
on Gtk.Button
.
The Welcome example in the Library has all 3. Play with it, try to understand and make changes. If you break things you can always go back by select "Welcome" example from the Workbench Library again.
Once you understand these 3 things, try creating something new. There are plenty of widgets and patterns to explore.
Library entries have 3 functions
- Showcase the capabilities of the platform
- Teach how to use the APIs, patterns and widgets
- Provide functional snippets ready to use
Pick a widget and make a Library demo for it within Workbench directly.
Check here for ideas.
Some guidelines
- Start with something small and accessible
- Focus on quality over quantity
- Make sure you don't pick something deprecated
- Select "Blueprint" instead of "XML" in the UI panel
- Keep it concise and interactive
- Add links to follow up on the topic covered
- Follow the patterns of existing entries
- Follow the Style Guide
cd demos
flatpak override --user --filesystem=$PWD re.sonny.Workbench
# restart Workbench
To create a new Library entry, duplicate an existing one and proceed to the next section.
cp -r src/Button src/Something
To update or port an existing Library entry
- Open Workbench
- Select "Open Project…" in the menu
- Select the corresponding demo folder, for example
src/Something
- Make the changes
Once you're satisfied with the result - you can send a pull request to include it in in this repository and Workbench.
Some guidelines:
- One pull request per Library entry
- Use a short PR title - eg. "Add Video entry" - it will be used as commit message
- If relevant, mention the related issue in the PR description
- Always review your own work before asking someone else
When you submit a PR and after approval, a GitHub workflow will trigger a series of tests. You can run tests locally with
# Ubuntu requirements
# sudo apt install flatpak flatpak-builder make
# Fedora requirements
# sudo dnf install flatpak flatpak-builder make
make setup
make test
Here is a compilation of resources to learn more about the GNOME platform.
- GObject
- GTK4 + GJS Book
- Asynchronous programming
- API references make sure to enable at least GTK, GJS, GLib, Gio
- GJS docs
- GJS examples