This is a simple example project, which can be used as a template/skeleton for creating new widgets.
For more information, see Creating a new widget.
Note: GitHub users can specify this repository as the template for a new repository by clicking the "Use this template" button.
- Replace the widget ID in the
meson.buildfile with the ID of your widget. - Change the metadata in the
widget.pyfile to match your widget's metadata. - Change the widget class name, and update the
_widget_classvariable at the bottom of the file. - If you're planning to use settings schemas, rename the
.xmlfile in theschemasdirectory to match your widget's ID and edit it to set the schema ID to your widget's ID.- If you're not planning to use settings schemas, remove the
schemasfolder and remove thesubdir('schemas')line from themeson.buildin the project's root.
- If you're not planning to use settings schemas, remove the
- Remove the example-specific .pot file from the
podirectory and regenerate the po/translation files by following the steps in theGenerating translation filessection.
meson --prefix="/usr" . output
meson compile -C output
sudo meson install -C outputOr, if you want to install the widget for the current user:
meson --prefix="$HOME/.local" . output
meson compile -C output
meson install -C outputNOTE: The following is automated by the po/update-po script. Make sure to edit it to change the widget ID before using it.
To generate the .pot file (this only needs to be done once, or whenever the widget ID changes):
meson . output
meson compile <widget id>-pot -C outputTo update the translations:
meson . output
meson compile <widget id>-update-po -C outputReplace <widget id> with your widget's ID (without the brackets).