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
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions gtk-default-themes.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/gtk/gtksettingsprivate.h b/gtk/gtksettingsprivate.h
index 47f75a6297..fd822c630a 100644
--- a/gtk/gtksettingsprivate.h
+++ b/gtk/gtksettingsprivate.h
@@ -23,8 +23,8 @@

G_BEGIN_DECLS

-#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.


void _gtk_settings_set_property_value_from_rc (GtkSettings *settings,
const gchar *name,
26 changes: 26 additions & 0 deletions io.elementary.Sdk.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,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.

"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.

"-Dtests=false",
"-Dx11_backend=true",
"-Dwayland-backend=true",
"-Dgtk_doc=true",
"-Dman=true",
"-Dintrospection=true",
"-Dtracker3=true"
],
"sources": [
{
"type": "git",
"url": "https://gitlab.gnome.org/GNOME/gtk.git",
"tag": "3.24.28"
},
{
"type": "patch",
"path": "gtk-default-themes.patch"
}
]
},
{
"name": "icons",
"buildsystem": "meson",
Expand Down