{"id":19118575,"url":"https://github.com/dkosmari/gtk-app-icons-test","last_synced_at":"2026-06-20T22:31:00.136Z","repository":{"id":231046560,"uuid":"780740654","full_name":"dkosmari/gtk-app-icons-test","owner":"dkosmari","description":"Simple Python GTK4 program to test if a symbolic icon will be recolored.","archived":false,"fork":false,"pushed_at":"2024-04-03T08:24:55.000Z","size":428,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-03T07:34:35.869Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dkosmari.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","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":"2024-04-02T04:23:12.000Z","updated_at":"2024-04-20T17:40:50.000Z","dependencies_parsed_at":"2025-01-03T07:42:03.433Z","dependency_job_id":null,"html_url":"https://github.com/dkosmari/gtk-app-icons-test","commit_stats":null,"previous_names":["dkosmari/gtk-app-icons-test"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dkosmari%2Fgtk-app-icons-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dkosmari%2Fgtk-app-icons-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dkosmari%2Fgtk-app-icons-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dkosmari%2Fgtk-app-icons-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dkosmari","download_url":"https://codeload.github.com/dkosmari/gtk-app-icons-test/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240171747,"owners_count":19759415,"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","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-11-09T05:07:01.851Z","updated_at":"2026-06-03T10:30:16.066Z","avatar_url":"https://github.com/dkosmari.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"GTK App Icons Test\n==================\n\nThis is a simple application to test how GTK+ 4.0 behaves when loading symbolic SVG icons.\n\nProgrammers usually intend for symbolic icons to be recolored to the text foreground\ncolor, thus adapting to the light/dark theme in use. But this feature is only enabled for\nsome use cases.\n\n![Screenshot](screenshot.png)\n\n\nHow to make recoloring work\n---------------------------\n\n  - The icon filename must be `*-symbolic.svg`.\n\n  - The icon must be packaged inside a `.gresource` file.\n\n  - The icon must be placed in a directory called `scalable/CONTEXT` where `CONTEXT` is\n    one of the context directories listed in the [Icon Naming\n    Specification](https://specifications.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html):\n\n    - `scalable/actions/`\n    - `scalable/animations/`\n    - `scalable/apps/`\n    - `scalable/categories/`\n    - `scalable/devices/`\n    - `scalable/emblems/`\n    - `scalable/emotes/`\n    - `scalable/intl/`\n    - `scalable/mimetypes/`\n    - `scalable/places/`\n    - `scalable/status/`\n\n  - The `.gresource` file must be loaded and registered:\n\n    ```python\n    resource = Gio.Resource.load(base_path + \"/icons.gresource\")\n    Gio.resources_register(resource)\n    ```\n\n  - When using `GtkApplication`, the application ID is used to derive a default search\n    path, `APP_ID/icons`. For instance, if the application ID is `org.gtk.app_icons_test`,\n    this resource path would work:\n\n    - `/org/gtk/app_icons_test/icons/scalable/emotes/foo-symbolic.svg`\n\n    When using different paths, you need to manually tell the `IconTheme` to search in it:\n\n    ```python\n    theme = Gtk.IconTheme.get_for_display(Gdk.Display.get_default())\n    theme.add_resource_path(\"/some/random/path\")\n    ```\n\n    Then this would also work:\n\n    - `/some/random/path/scalable/emotes/foo-symbolic.svg`\n\n  - If the icon has only one color, the recoloring is as expected, it is replaced by the\n    foreground color. If it has multiple colors, they will all receive the foreground\n    color. GTK+ understands three symbolic colors: `success`, `warning` and `error`. The\n    SVG elements must have `class=\"success\"`, `class=\"warning\"` or `class=\"error\"` for\n    these colors to be used. See the\n    [icons/real-target-symbolic.svg](icons/real-target-symbolic.svg) for an example.\n\n\nRunning the test application\n----------------------------\n\n - `make`\n   - This will compile the `icons.gresource` file.\n\n - `./main.py`\n   - This will use the default theme.\n\n - `./main.py light`\n   - This will force the use of the light theme.\n\n - `./main.py dark`\n   - This will force the use of the dark theme.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdkosmari%2Fgtk-app-icons-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdkosmari%2Fgtk-app-icons-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdkosmari%2Fgtk-app-icons-test/lists"}