create account

Automatically installing Gtk themes in Flatpak by tingping

View this thread on: hive.blogpeakd.comecency.com
· @tingping · (edited)
$66.98
Automatically installing Gtk themes in Flatpak
In order for Flatpak'd applications to integrate with the system they require having themes installed but sadly this has always been a manual process. Thankfully Flatpak has a feature for basic conditional statements in runtimes for automatically downloading or enabling extensions if a condition is met. These conditions are [defined within flatpak itself](https://github.com/flatpak/flatpak/blob/c60b5d7e7c63a12fccb92b7f1fcafc81afde2930/common/flatpak-utils.c#L4238-L4279) so I added `active-gtk-theme`.

This condition currently pulls from [DConf](https://en.wikipedia.org/wiki/Dconf) looking up the `gtk-theme` key in the `org.gnome.desktop.interface` schema which is set automatically by GNOME and thanks to [a recent addition](https://bugs.kde.org/show_bug.cgi?id=387417) KDE.

On other platforms it would be necessary to pull the information from [XSettings](https://specifications.freedesktop.org/xsettings-spec/xsettings-spec-0.5.html) but that is sadly a non-trivial protocol and would likely mean a dependency on xlib which is not desired so has not been implemented at this time.

Once the condition is met at `update` or `install` time `flatpak` will automatically install matching extensions.

Merge request: https://github.com/flatpak/flatpak/pull/1181 and 
 https://github.com/flatpak/freedesktop-sdk-images/pull/60

<br /><hr/><em>Posted on <a href="https://utopian.io/utopian-io/@tingping/automatically-installing-gtk-themes-in-flatpak">Utopian.io -  Rewarding Open Source Contributors</a></em><hr/>
👍  , , , , ,
properties (23)
authortingping
permlinkautomatically-installing-gtk-themes-in-flatpak
categoryutopian-io
json_metadata"{"community":"utopian","app":"utopian/1.0.0","format":"markdown","repository":{"score":133.45567,"default_branch":"master","watchers":1181,"open_issues":258,"forks":123,"license":{"url":"https://api.github.com/licenses/lgpl-2.1","spdx_id":"LGPL-2.1","name":"GNU Lesser General Public License v2.1","key":"lgpl-2.1"},"open_issues_count":258,"archived":false,"mirror_url":null,"forks_count":123,"has_pages":true,"has_wiki":true,"has_downloads":true,"has_projects":true,"has_issues":true,"language":"C","watchers_count":1181,"stargazers_count":1181,"size":9833,"homepage":"http://flatpak.org","svn_url":"https://github.com/flatpak/flatpak","clone_url":"https://github.com/flatpak/flatpak.git","ssh_url":"git@github.com:flatpak/flatpak.git","git_url":"git://github.com/flatpak/flatpak.git","pushed_at":"2017-12-28T22:54:23Z","updated_at":"2017-12-29T15:55:20Z","created_at":"2016-05-19T14:19:21Z","deployments_url":"https://api.github.com/repos/flatpak/flatpak/deployments","releases_url":"https://api.github.com/repos/flatpak/flatpak/releases{/id}","labels_url":"https://api.github.com/repos/flatpak/flatpak/labels{/name}","notifications_url":"https://api.github.com/repos/flatpak/flatpak/notifications{?since,all,participating}","milestones_url":"https://api.github.com/repos/flatpak/flatpak/milestones{/number}","pulls_url":"https://api.github.com/repos/flatpak/flatpak/pulls{/number}","issues_url":"https://api.github.com/repos/flatpak/flatpak/issues{/number}","downloads_url":"https://api.github.com/repos/flatpak/flatpak/downloads","archive_url":"https://api.github.com/repos/flatpak/flatpak/{archive_format}{/ref}","merges_url":"https://api.github.com/repos/flatpak/flatpak/merges","compare_url":"https://api.github.com/repos/flatpak/flatpak/compare/{base}...{head}","contents_url":"https://api.github.com/repos/flatpak/flatpak/contents/{+path}","issue_comment_url":"https://api.github.com/repos/flatpak/flatpak/issues/comments{/number}","comments_url":"https://api.github.com/repos/flatpak/flatpak/comments{/number}","git_commits_url":"https://api.github.com/repos/flatpak/flatpak/git/commits{/sha}","commits_url":"https://api.github.com/repos/flatpak/flatpak/commits{/sha}","subscription_url":"https://api.github.com/repos/flatpak/flatpak/subscription","subscribers_url":"https://api.github.com/repos/flatpak/flatpak/subscribers","contributors_url":"https://api.github.com/repos/flatpak/flatpak/contributors","stargazers_url":"https://api.github.com/repos/flatpak/flatpak/stargazers","languages_url":"https://api.github.com/repos/flatpak/flatpak/languages","statuses_url":"https://api.github.com/repos/flatpak/flatpak/statuses/{sha}","trees_url":"https://api.github.com/repos/flatpak/flatpak/git/trees{/sha}","git_refs_url":"https://api.github.com/repos/flatpak/flatpak/git/refs{/sha}","git_tags_url":"https://api.github.com/repos/flatpak/flatpak/git/tags{/sha}","blobs_url":"https://api.github.com/repos/flatpak/flatpak/git/blobs{/sha}","tags_url":"https://api.github.com/repos/flatpak/flatpak/tags","branches_url":"https://api.github.com/repos/flatpak/flatpak/branches{/branch}","assignees_url":"https://api.github.com/repos/flatpak/flatpak/assignees{/user}","events_url":"https://api.github.com/repos/flatpak/flatpak/events","issue_events_url":"https://api.github.com/repos/flatpak/flatpak/issues/events{/number}","hooks_url":"https://api.github.com/repos/flatpak/flatpak/hooks","teams_url":"https://api.github.com/repos/flatpak/flatpak/teams","collaborators_url":"https://api.github.com/repos/flatpak/flatpak/collaborators{/collaborator}","keys_url":"https://api.github.com/repos/flatpak/flatpak/keys{/key_id}","forks_url":"https://api.github.com/repos/flatpak/flatpak/forks","url":"https://api.github.com/repos/flatpak/flatpak","fork":false,"description":"Linux application sandboxing and distribution framework (formerly xdg-app)","html_url":"https://github.com/flatpak/flatpak","private":false,"owner":{"site_admin":false,"type":"Organization","received_events_url":"https://api.github.com/users/flatpak/received_events","events_url":"https://api.github.com/users/flatpak/events{/privacy}","repos_url":"https://api.github.com/users/flatpak/repos","organizations_url":"https://api.github.com/users/flatpak/orgs","subscriptions_url":"https://api.github.com/users/flatpak/subscriptions","starred_url":"https://api.github.com/users/flatpak/starred{/owner}{/repo}","gists_url":"https://api.github.com/users/flatpak/gists{/gist_id}","following_url":"https://api.github.com/users/flatpak/following{/other_user}","followers_url":"https://api.github.com/users/flatpak/followers","html_url":"https://github.com/flatpak","url":"https://api.github.com/users/flatpak","gravatar_id":"","avatar_url":"https://avatars0.githubusercontent.com/u/19473042?v=4","id":19473042,"login":"flatpak"},"full_name":"flatpak/flatpak","name":"flatpak","id":59213200},"pullRequests":[],"platform":"github","type":"development","tags":["utopian-io","linux","flatpak","gtk","gnome"],"users":["tingping"],"links":["https://github.com/flatpak/flatpak/blob/c60b5d7e7c63a12fccb92b7f1fcafc81afde2930/common/flatpak-utils.c#L4238-L4279","https://en.wikipedia.org/wiki/Dconf","https://bugs.kde.org/show_bug.cgi?id=387417","https://specifications.freedesktop.org/xsettings-spec/xsettings-spec-0.5.html"]}"
created2017-12-29 23:29:15
last_update2017-12-29 23:29:57
depth0
children2
last_payout2018-01-05 23:29:15
cashout_time1969-12-31 23:59:59
total_payout_value46.381 HBD
curator_payout_value20.594 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,517
author_reputation637,453,434,557
root_title"Automatically installing Gtk themes in Flatpak"
beneficiaries
0.
accountutopian.pay
weight2,500
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id25,957,303
net_rshares6,247,670,690,666
author_curate_reward""
vote details (6)
@dutch ·
Thank you for the contribution. It has been approved.

I will accept this work. However, in future if you are submitting very small contributions you should merge 2 or 3 pull requests to submit in the development category.

You can contact us on [Discord](https://discord.gg/UCvqCsx).
**[[utopian-moderator]](https://utopian.io/moderators)**
properties (22)
authordutch
permlinkre-tingping-automatically-installing-gtk-themes-in-flatpak-20171230t121328131z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"community":"utopian","app":"utopian/1.0.0"}
created2017-12-30 12:13:30
last_update2017-12-30 12:13:30
depth1
children0
last_payout2018-01-06 12:13:30
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length341
author_reputation11,905,004,165,125
root_title"Automatically installing Gtk themes in Flatpak"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id26,038,086
net_rshares0
@utopian-io ·
### Hey @tingping I am @utopian-io. I have just upvoted you!
#### Achievements
- You have less than 500 followers. Just gave you a gift to help you succeed!
- Seems like you contribute quite often. AMAZING!
#### Community-Driven Witness!
I am the first and only Steem Community-Driven Witness. <a href="https://discord.gg/zTrEMqB">Participate on Discord</a>. Lets GROW TOGETHER!
- <a href="https://v2.steemconnect.com/sign/account-witness-vote?witness=utopian-io&approve=1">Vote for my Witness With SteemConnect</a>
- <a href="https://v2.steemconnect.com/sign/account-witness-proxy?proxy=utopian-io&approve=1">Proxy vote to Utopian Witness with SteemConnect</a>
- Or vote/proxy on <a href="https://steemit.com/~witnesses">Steemit Witnesses</a>

[![mooncryption-utopian-witness-gif](https://steemitimages.com/DQmYPUuQRptAqNBCQRwQjKWAqWU3zJkL3RXVUtEKVury8up/mooncryption-s-utopian-io-witness-gif.gif)](https://steemit.com/~witnesses)

**Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x**
properties (22)
authorutopian-io
permlinkre-tingping-automatically-installing-gtk-themes-in-flatpak-20171230t164240219z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"community":"utopian","app":"utopian/1.0.0"}
created2017-12-30 16:42:39
last_update2017-12-30 16:42:39
depth1
children0
last_payout2018-01-06 16:42:39
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,084
author_reputation152,955,367,999,756
root_title"Automatically installing Gtk themes in Flatpak"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id26,075,292
net_rshares0