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

modify gnome-shell-theme.gresource #2945

Closed
wants to merge 15 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion debian/rules
Expand Up @@ -6,7 +6,6 @@

override_dh_auto_configure:
dh_auto_configure -- \
-Dgnome-shell-gresource=true \
-Dubuntu-unity=true \
-Dxfwm4=true

Expand Down
4 changes: 2 additions & 2 deletions debian/yaru-theme-gnome-shell.install
@@ -1,3 +1,3 @@
usr/share/gnome-shell/
usr/share/themes/Yaru/gnome-shell
usr/share/themes/Yaru-light/gnome-shell/
usr/share/themes/Yaru/gnome-shell/
usr/share/themes/Yaru-dark/gnome-shell/
14 changes: 14 additions & 0 deletions gnome-shell/src/dark/meson.build
@@ -0,0 +1,14 @@
# This is an hack we need to remove once meson fixes this issue:
# https://github.com/mesonbuild/meson/issues/2320

custom_target('style-css-@0@'.format(variant),
input: style_css,
output: output_styles,
command: [
gnomeshell_copy_and_rename,
'--input', '@INPUT@',
'--output', '@OUTPUT@',
],
install: true,
install_dir: install_dir,
)
10 changes: 5 additions & 5 deletions gnome-shell/src/data/gnome-shell-theme.gresource.xml
Expand Up @@ -39,10 +39,10 @@
<file>toggle-on-hc.svg</file>

<!-- Use Yaru files for ubuntu's special gdm and default gnome-shell css -->
<file alias="gdm.css">gnome-shell.css</file>
<file alias="Yaru/gnome-shell.css">gnome-shell.css</file>
<file alias="Yaru/gnome-shell-high-contrast.css">gnome-shell-high-contrast.css</file>
<file alias="Yaru-light/gnome-shell.css">gnome-shell-light.css</file>
<file alias="Yaru-light/gnome-shell-high-contrast.css">gnome-shell-high-contrast-light.css</file>
<file alias="gdm.css">gnome-shell-dark.css</file>
<file>gnome-shell.css</file>
<file>gnome-shell-high-contrast.css</file>
<file>gnome-shell-dark.css</file>
<file>gnome-shell-high-contrast-dark.css</file>
</gresource>
</gresources>
11 changes: 11 additions & 0 deletions gnome-shell/src/install-themes-for-switching.sh
@@ -0,0 +1,11 @@
#!/usr/bin/env bash
# -*- coding: UTF-8 -*-

project_name="$1"
project_lname="$2"
gnomeshell_theme_dir="${MESON_INSTALL_DESTDIR_PREFIX}/$3"
variant_suffix="$4"
variant_target="${gnomeshell_theme_dir}/${project_name}${variant_suffix}/gnome-shell.css"
variant_symlink="${gnomeshell_theme_dir}/${project_lname}${variant_suffix}.css"

cp $variant_target $variant_symlink
2 changes: 1 addition & 1 deletion gnome-shell/src/light/meson.build
@@ -1,7 +1,7 @@
# This is an hack we need to remove once meson fixes this issue:
# https://github.com/mesonbuild/meson/issues/2320

custom_target('style-css-@0@'.format(variant),
custom_target('style-css',
input: style_css,
output: output_styles,
command: [
Expand Down
23 changes: 17 additions & 6 deletions gnome-shell/src/meson.build
Expand Up @@ -45,7 +45,7 @@ if not gnomeshell_use_gresource
endif

foreach variant: variants
is_variant = variant != 'dark'
is_variant = variant != 'light'
variant_suffix = is_variant ? '-@0@'.format(variant) : ''

if gnomeshell_use_gresource
Expand Down Expand Up @@ -87,6 +87,16 @@ foreach variant: variants
depend_files: theme_sources,
)
endforeach

if not gnomeshell_use_gresource
meson.add_install_script(
'install-themes-for-switching.sh',
meson.project_name(),
meson.project_name().to_lower(),
gnomeshell_default_theme_dir,
variant_suffix
)
endif

theme_css += style_css

Expand All @@ -96,6 +106,10 @@ foreach variant: variants
if is_variant
subdir(variant)
endif

Copy link
Member

Choose a reason for hiding this comment

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

I suspect this two if blocks (between 106 and 112) are not necessary anymore. is_variant is true if variant != light right? So:

  • if is_variant is true, then variant == 'light' and the subdir command is equal to subdir('light')
  • if is_variant is false, then variant != 'light', but subdir command is still equal to subdir('light)

I believe this was necessary when the variantes were three (default, light and dark).

if not is_variant
subdir('light')
endif

ignore_variants = []
if not is_variant
Expand Down Expand Up @@ -138,9 +152,6 @@ if gnomeshell_use_gresource
install_dir: gnomeshell_theme_dir,
)
else
# Symlink variants
foreach variant: variants
variant_suffix = (variant != 'dark') ? '-@0@'.format(variant) : ''
meson.add_install_script('install-shell.sh', meson.project_name() + variant_suffix)
endforeach
# Symlink default variant
meson.add_install_script('install-shell.sh', meson.project_name())
endif
2 changes: 1 addition & 1 deletion meson_options.txt
@@ -1,6 +1,6 @@
option('icons', type: 'boolean', value: true, description:'build icons component')
option('gnome-shell', type: 'boolean', value: true, description:'build gnome-shell component')
option('gnome-shell-gresource', type: 'boolean', value: false, description: 'build gnome-shell component in gresources')
option('gnome-shell-gresource', type: 'boolean', value: true, description: 'build gnome-shell component in gresources')
option('gtk', type: 'boolean', value: true, description:'build gtk component')
option('gtksourceview', type: 'boolean', value: true, description:'build gtksourceview component')
option('metacity', type: 'boolean', value: true, description:'build metacity component')
Expand Down
2 changes: 1 addition & 1 deletion sessions/mode.json.in
@@ -1,6 +1,6 @@
{
"parentMode": "user",
"stylesheetName": "@ThemeName@/gnome-shell.css",
"stylesheetName": "gnome-shell.css",
"themeResourceName": "@ThemeResourcePath@gnome-shell-theme.gresource",
"enabledExtensions": ["ubuntu-dock@ubuntu.com", "ubuntu-appindicators@ubuntu.com"]
}