Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make elementary themes the default fallback #30

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

tintou
Copy link
Member

@tintou tintou commented Apr 21, 2021

Fixes #72

  • Patches GTK to use the elementary stylesheet as the built-in fallback
  • Includes GTK as a module in the Flatpak manifest, applying the patch

"buildsystem": "meson",
"config-opts": [
"-Dbroadway_backend=true",
"-Dinstalled_tests=true",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't need the tests in the runtime

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, gnome-build-meta acts as project wide CI too so we want to make sure they are built there. We filter the produced binaries out from the runtime afterwards.

}
],
"build-commands": [
"install -Dm644 gtk/settings.ini /etc/gtk-3.0/settings.ini"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better if it was installed /usr/etc instead. I'd be surprised if /etc made it to the compose.

Suggested change
"install -Dm644 gtk/settings.ini /etc/gtk-3.0/settings.ini"
"install -Dm644 gtk/settings.ini /usr/etc/gtk-3.0/settings.ini"

@@ -41,6 +41,32 @@
}
},
"modules": [
{
"name": "gtk",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure exactly what's going on but when trying to build locally it fails like this:

Running custom install script '/usr/bin/python3 /run/build-runtime/gtk/build-aux/meson/post-install.py 3.0 3.0.0 /usr/bin /usr/lib/x86_64-linux-gnu /usr/share'
--- stdout ---
Compiling GSettings schemas...
Updating icon cache...
Updating module cache for input methods...

--- stderr ---
Warning: Schema “org.gnome.crypto.pgp” has path “/desktop/gnome/crypto/pgp/”.  Paths starting with “/apps/”, “/desktop/” or “/system/” are deprecated.
Warning: Schema “org.gnome.system.locale” has path “/system/locale/”.  Paths starting with “/apps/”, “/desktop/” or “/system/” are deprecated.
Warning: Schema “org.gnome.system.proxy” has path “/system/proxy/”.  Paths starting with “/apps/”, “/desktop/” or “/system/” are deprecated.
Warning: Schema “org.gnome.system.proxy.http” has path “/system/proxy/http/”.  Paths starting with “/apps/”, “/desktop/” or “/system/” are deprecated.
Warning: Schema “org.gnome.system.proxy.https” has path “/system/proxy/https/”.  Paths starting with “/apps/”, “/desktop/” or “/system/” are deprecated.
Warning: Schema “org.gnome.system.proxy.ftp” has path “/system/proxy/ftp/”.  Paths starting with “/apps/”, “/desktop/” or “/system/” are deprecated.
Warning: Schema “org.gnome.system.proxy.socks” has path “/system/proxy/socks/”.  Paths starting with “/apps/”, “/desktop/” or “/system/” are deprecated.
Traceback (most recent call last):
  File "/run/build-runtime/gtk/build-aux/meson/post-install.py", line 45, in <module>
    immodule_cache_file = open(os.path.join(gtk_moduledir, 'immodules.cache'), 'w')
OSError: [Errno 30] Read-only file system: '/usr/lib/x86_64-linux-gnu/gtk-3.0/3.0.0/immodules.cache'

FAILED: install script '/usr/bin/python3 /run/build-runtime/gtk/build-aux/meson/post-install.py 3.0 3.0.0 /usr/bin /usr/lib/x86_64-linux-gnu /usr/share' exit code 1, stopped
FAILED: meson-install 
/usr/bin/meson install --no-rebuild
ninja: build stopped: subcommand failed.
Error: module gtk: Child process exited with code 1

Copy link

@gasinvein gasinvein Oct 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alatiera I guess this is rofiles-fuse preventing modifications to already-existing file. One way to fix this would be adding the path to ensure-writable property of the gtk module, like this:

"ensure-writable": [
  "/lib/x86_64-linux-gnu/gtk-3.0/3.0.0/immodules.cache"
]

Or just running flatpak-builder with --disable-rofiles-fuse.
Or patching the post-install.py script to replace the file instead of editing it in-place.

}
],
"build-commands": [
"ln -S /usr/share/themes/io.elementary.stylesheet.blueberry /usr/share/themes/elementary"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where does this help, an app will either be built against eos5 or eos6 right? at which point will it a eos6 app be expecting elementary as the name?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the user is on eOS 5 then its theme name will be elementary and might be exported, that helps with the fallback

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we want make the same with Adwaita? or is better to remove them from the Sdk and let the fallback manage it?

-#define DEFAULT_THEME_NAME "Adwaita"
-#define DEFAULT_ICON_THEME "Adwaita"
+#define DEFAULT_THEME_NAME "io.elementary.stylesheet.blueberry"
+#define DEFAULT_ICON_THEME "elementary"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't think there's a non-intentional way to use the icon fallback on flatpak, the host icons folder is mounted on the sandbox, so the selected theme is always found.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, given the fact Dippi for instance automatically overrides even the icon theme, I wonder if Dippi's strategy can be incorporated directly into the platform.

@cassidyjames
Copy link
Contributor

We probably want to solve this sooner than later, as we've started advertising the .flatpakref files on the AppCenter website.

@danirabbit danirabbit mentioned this pull request Dec 3, 2021
1 task
@gasinvein
Copy link

gasinvein commented Feb 10, 2022

Any progress on this? Looks like it was targeting 6.1 release, but AppCenter apps built on the 6.1 platform are still using Adwaita theme on my GNOME 41 machine.

@dominichayesferen
Copy link

Triargers: Given elementary/granite@6f035b7, is this merge request now technically redundant?

@tintou
Copy link
Member Author

tintou commented Apr 11, 2023

Triargers: Given elementary/granite@6f035b7, is this merge request now technically redundant?

No it's still required

@dominichayesferen

This comment was marked as spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: To Discuss
Development

Successfully merging this pull request may close these issues.

GTK settings in distributions like Feren OS is set to an invalid value
7 participants