🖥️
GNOME Developer Handbook
  • Introduction
  • Writing Apps using Python
    • The Setup
    • The Build System
    • Understanding Widgets, Layouts & Templates
    • Working with GIO: GSettings
    • Working with Widgets
    • Asynchronous operations
    • Working with GIO: GActions
Powered by GitBook
On this page
  • Some Prerequisites
  • Installing GNOME Builder
  • What will we be building?
  • Creating a new project in Builder

Was this helpful?

  1. Writing Apps using Python

The Setup

Let's get started!

PreviousIntroductionNextThe Build System

Last updated 4 years ago

Was this helpful?

Some Prerequisites

  • Install git

  • Sign up on a git hosting provider (//)

Installing

Install Builder using your distributions package manager

  • Most of the distributions have Builder in their default repositories. You can directly install builder using your trusty package manager.

(or) Install Builder using Flatpak

  • Install (Flatpak is a package/application manager) , instructions to install flatpak on your distribution can be found

  • Setup by issuing this command in the terminal

flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
  • A restart is recommended at this point. Later issue this command in the terminal to install GNOME Builder. GNOME Builder is a made using GNOME technologies.

flatpak install flathub org.gnome.Builder

That is about all you need to get started!

What will we be building?

We will be building a desktop application which will fetch random pictures from and set them as desktop wallpaper.

The UI will be fairly simple, there will be one button on the header bar called shuffle. On press, it will fetch a new wallpaper, show the wallpaper on the window and automatically set the wallpaper. Our application will also have an about dialog and a shortcuts dialog.

Creating a new project in Builder

Open Builder

Click on Start New Project , Let us call our project name Splash!

An App ID is a unique identifier for an application on the desktop. The idea is to make sure multiple applications in the same system do not conflict. This can be achieved by using something called the Reverse Domain Naming Notion (or RDNN in short). So let us name the App ID to be com.yourusername.splash (replace your user name here, and make sure you do that step from here on)

Select the language as Python and the we will leave the default license selection for now.

Looks good. Click on Create Project to create the project in your Projects folder!

Open the project, you will be welcomed with a screen like this

Click on the first top left editor icon and click on Build Preferences

Select the Default build configuration and click on Make Active. Now click on the Play (▶️) button to start running the application. There should be a new window which pops up saying Hello World!

Congratulations! Next up let us understand what are the files which were auto generated and how an application is actually built.

Github
GitLab
GNOME's GitLab instance
GNOME Builder
Flatpak
here
flathub
Integrated development environment (IDE)
UnSplash
Builder start screen
Starting a new project
GNOME Builder welcome screen
Select Build configuration screen
Hello World!