Gtk Application Tools

A set of tools to create and develop GNOME and Gtk applications for free desktop systems easily, in a similar spirit to Ubuntu Quickly.

They are hosted in github as separate projects for now, but might be merged soon.

gtk-app-generator

Generates a new application from a template, hiding all the boring copy-paste stuff from the developer. Includes templates for Gjs and PyGObject applications that handle autotools, i18n, gtkbuilder, gsettings, appdata, desktop files, etc.

It's a command line utility written in python + standard library.

gnome-app-tool

An editor for declarative files such as desktop files, app data files, GSettings, etc. that should be handled by an IDE but for which an IDE is currently missing.

It's a graphical application written in JS.

How to use it

  • Generate a new application skeleton, running the generator tool from the repository, eg.

./gtk-app-generator.py com.github.user.FancyApplication -N "The Application Name" -B fancy-application -o ~/gnome --summary "A short description of the app" --url http://www.example.com/fancy-application

This will create a folder under ~/gnome/ called fancy-application, and initialize it with an GIT repository. It will take care of the initial commit too.

  • Switch to the application repository and set it up

./autogen.sh --prefix=/usr/local --libdir=/usr/local/lib64
make
  • Interesting files to edit:
    • data/ is for data files, and src/ for source files
    • data/app-menu.ui has the application menu, in GtkBuilder format

    • data/main.ui has the header bar and one empty grid for the application, you'll probably want to replace this with something appropriate to your app
    • data/com.github.user.FancyApplication.appdata.xml.in is the appdata description (for gnome-software), and data/com.github.user.FancyApplication.desktop.in is the desktop file (for the gnome-shell app picker)

    • data/com.github.user.FancyApplication.gschema.xml has the GSettings schemas

    • If you need to add one source module, edit src/Makefile.am
    • If you need to add one data file that can be loaded by the application (eg. CSS or image), edit src/com.github.user.FancyApplication.gresource.xml. You don't need to edit data/Makefile.am, it will be compiled and distributed automatically

  • How to run the application:

./src/fancy-application

/!\ If you are writing a JS application, you need to install it once, to make sure package.js is visible. See 690136

/!\ If you are using jhbuild, you can't run your application installed (ie from gnome-shell), unless you are in a full jhbuild session, because dbus will not pick the right service file. Run it uninstalled instead.

GiovanniCampagna/Experiments/ApplicationTools (last edited 2013-10-03 15:36:38 by GiovanniCampagna)