{"id":23727883,"url":"https://github.com/relm4/relm4-template","last_synced_at":"2025-09-04T05:30:34.821Z","repository":{"id":41118275,"uuid":"508401304","full_name":"Relm4/relm4-template","owner":"Relm4","description":null,"archived":false,"fork":false,"pushed_at":"2025-01-25T22:35:46.000Z","size":641,"stargazers_count":34,"open_issues_count":5,"forks_count":8,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-05T02:11:08.380Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Relm4.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-06-28T17:50:54.000Z","updated_at":"2025-02-09T22:14:25.000Z","dependencies_parsed_at":"2024-12-02T09:30:13.620Z","dependency_job_id":null,"html_url":"https://github.com/Relm4/relm4-template","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/Relm4/relm4-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Relm4%2Frelm4-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Relm4%2Frelm4-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Relm4%2Frelm4-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Relm4%2Frelm4-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Relm4","download_url":"https://codeload.github.com/Relm4/relm4-template/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Relm4%2Frelm4-template/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273555592,"owners_count":25126345,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-04T02:00:08.968Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-31T01:46:42.630Z","updated_at":"2025-09-04T05:30:34.804Z","avatar_url":"https://github.com/Relm4.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GTK + Rust + Relm4 + Meson + Flatpak = \u003c3\n\n\u003e This is a fork of [gtk-rust-template](https://gitlab.gnome.org/World/Rust/gtk-rust-template) that adapts the code for Relm4 while trying to change as little as possible.\n\nA boilerplate template to get started with GTK, Rust, Meson, Flatpak made for GNOME. It can be adapted for other desktop environments like elementary.\n\n\u003cdiv align=\"center\"\u003e\n\n![Main window](data/resources/screenshots/screenshot1.png \"Main window\")\n\u003c/div\u003e\n\n## What does it contains?\n\n- A simple window with a headerbar\n- Bunch of useful files that you SHOULD ship with your application on Linux:\n  - Metainfo: describe your application for the different application stores out there;\n  - Desktop: the application launcher;\n  - Icons: This repo contains three icons, a normal, a nightly \u0026 monochromatic icon (symbolic) per the GNOME HIG, exported using [App Icon Preview](https://flathub.org/apps/details/org.gnome.design.AppIconPreview).\n- Flatpak Manifest for nightly builds\n- Dual installation support\n- Uses Meson for building the application\n- Bundles the UI files \u0026 the CSS using gresources\n- A pre-commit hook to run rustfmt on your code\n- Tests to validate your Metainfo, Schemas \u0026 Desktop files\n- Gsettings to store the window state, more settings could be added\n- Gitlab CI to produce flatpak nightlies\n- i18n support\n\n## How to init a project ?\n\nThe template ships a simple python script to init a project easily. It asks you a few questions and replaces \u0026 renames all the necessary files.\n\nThe script requires having `git` installed on your system.\n\nIf you clone this repository, you can run it with:\n\n```shell\npython3 create-project.py\n```\n\nIf you don't want to clone the repository, you can run it with:\n\n```shell\npython3 -c \"$(wget -q -O - https://raw.githubusercontent.com/Relm4/relm4-template/main/create-project.py)\" --online\n```\n\n```shell\n➜ python3 create-project.py\nWelcome to GTK Rust Template\nName: Contrast\nProject Name: contrast\nApplication ID (e.g. org.domain.MyAwesomeApp, see: https://developer.gnome.org/ChooseApplicationID/): org.gnome.design.Contrast\nAuthor: Bilal Elmoussaoui\nEmail: bil.elmoussaoui@gmail.com\n```\n\nA new directory named `contrast` containing the generated project\n\n## Building the project\n\nMake sure you have `flatpak` and `flatpak-builder` installed. Then run the commands below. Replace `\u003capplication_id\u003e` with the value you entered during project creation. Please note that these commands are just for demonstration purposes. Normally this would be handled by your IDE, such as GNOME Builder or VS Code with the Flatpak extension.\n\n```shell\nflatpak install --user org.gnome.Sdk//46 org.gnome.Platform//46  org.freedesktop.Sdk.Extension.rust-stable//23.08 org.freedesktop.Sdk.Extension.llvm16//23.08\nflatpak-builder --user flatpak_app build-aux/\u003capplication_id\u003e.Devel.json\n```\n\n## Running the project\n\nOnce the project is build, run the command below. Replace `\u003capplication_id\u003e` and `\u003cproject_name\u003e` with the values you entered during project creation. Please note that these commands are just for demonstration purposes. Normally this would be handled by your IDE, such as GNOME Builder or VS Code with the Flatpak extension.\n\n```shell\nflatpak-builder --run flatpak_app build-aux/\u003capplication_id\u003e.Devel.json \u003cproject_name\u003e\n```\n\n## Translations with Gettext\n\nThe template uses `gettext` as a framework for translations using [`gettext-rs`](https://github.com/gettext-rs/gettext-rs). The basic files for this can be found in the `po` folder.\nWhile meson will take care of building the translations the extraction and translation itself has to be done manually.\n\n### Extracting translatable strings\n\nFirst of all you have to have `gettext` installed on your system. With that you then are able to use `xgettext` as following to extract the translatable strings:\n\n```shell\nxgettext --package-name=\u003cproject_name\u003e --package-version=main --msgid-bugs-address=https://github.com/\u003cproject_name\u003e/\u003cproject_name\u003e/issues --files-from=po/POTFILES.in --output=po/\u003cproject_name\u003e.pot\n```\n\nNote that you might need to update the `po/POTFILES.in` file to reflect the files of your process. This describes where `xgettext` is going to search for strings to translate.\n\n### Translating the translatable strings\n\nTo translate the strings you need to use po files. Tools like Poedit allow you to generate these from the `po/\u003cproject_name\u003e.pot` file.\nIt also allows you to sync the `po/\u003cproject_name\u003e.pot` when you rerun `xgettext`.\n\nWhen adding a po file also make sure to add the language code to `po/LINGUAS`.\n\n## Community\n\nJoin the GNOME and gtk-rs community!\n\n- [Matrix chat](https://matrix.to/#/#rust:gnome.org): chat with other developers using gtk-rs\n- [Discourse forum](https://discourse.gnome.org/tag/rust): topics tagged with `rust` on the GNOME forum.\n- [GNOME circle](https://circle.gnome.org/): take inspiration from applications and libraries already extending the GNOME ecosystem.\n\n## Credits\n\n- [Podcasts](https://gitlab.gnome.org/World/podcasts)\n- [Shortwave](https://gitlab.gnome.org/World/Shortwave)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frelm4%2Frelm4-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frelm4%2Frelm4-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frelm4%2Frelm4-template/lists"}