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

shell: enable shell variant switch #1578

Merged
merged 3 commits into from Oct 21, 2019

Conversation

@clobrano
Copy link
Member

clobrano commented Oct 19, 2019

  • generate both light (current default) and dark shell variants
  • install variants in /usr/share/themes/Yaru/gnome-shell and /usr/share/themes/Yaru-dark/gnome/shell
  • symlink default variant to /usr/share/themes/

Once installed "User themes" extension, both shell variants are
manually selectable, also in GNOME vanilla session.

closes #1483

- generate both light (current default) and dark shell variants
- symlink light variant to /usr/share/themes/Yaru
- install dark variant in /usr/share/themes/Yaru-dark

Once installed "User themes" extension, both shell variants are
manually selectionable, also in GNOME vanilla session.
@memeplex

This comment has been minimized.

Carlo, be aware that you have these absolute symlinks to your home dir all over the place. Besides, do you really need to symlink the sources? Why not just symlink the output in the build file as needed?

@roypen

This comment has been minimized.

Copy link

roypen commented Oct 19, 2019

Works great after changing the symlinks mentioned above. Tested on a 19.10 clean install.

@@ -1,3 +1,4 @@
gnomeshell_theme_dir = join_paths(get_option('datadir'), 'gnome-shell', 'theme')
gnomeshell_alt_theme_dir = join_paths(get_option('datadir'), 'themes')

This comment has been minimized.

Copy link
@memeplex

memeplex Oct 19, 2019

Maybe gnomeshell_alt_themes_dir (plural) because in the future you might have more than one alternative (for example, light and dark, besides the current "darker"). Also it better matches the name of the themes folder.

]

# install static data files
install_data(data_sources, install_dir: install_dir)

This comment has been minimized.

Copy link
@memeplex

memeplex Oct 19, 2019

There is obviously a lot of duplication in this file.

My first impulse would usually be to factorize everything that is not the install_dir parameter. For example, to symlink the base build file and provide install_dir as a parameter or as part of an environment (I'm not familiarized with meson).

But in this case I believe this file could be seen as a place for little tweaks and hacks that could be required in the future to adjust the theme variant (for example, different icons), so in the end I have no strong opinion.

This comment has been minimized.

Copy link
@clobrano

clobrano Oct 20, 2019

Author Member

it is easier if the install dir is shared

This comment has been minimized.

Copy link
@clobrano

clobrano Oct 20, 2019

Author Member

I think I'll keep them separated tough. The custom-target directive now generates two different targets, one for light and one for dark, with the same name gnome-shell.scss, while keeping it in the same meson build is causing target duplication which resolution makes this even more complicated

@@ -0,0 +1,83 @@
# destination directory
install_dir = join_paths(gnomeshell_theme_dir, meson.project_name())

This comment has been minimized.

Copy link
@memeplex

memeplex Oct 19, 2019

As I commented in #1483 (comment), I believe it's better here to keep symmetry with what you're doing for the dark theme, that is:

install_dir = join_paths(gnomeshell_alt_theme_dir, meson.project_name() + '-light', 'gnome-shell')

and then to invert the symlinking in install-shell.sh. This better generalizes to future variants, also. And it follows the time-tested pattern of symlinking the chosen variant between a set of configuration options.

project_name="$1"
prefix="${MESON_INSTALL_DESTDIR_PREFIX}/share"

ln -sf "${prefix}/gnome-shell/theme/${project_name}" "${prefix}/themes/${project_name}/gnome-shell"

This comment has been minimized.

Copy link
@memeplex

memeplex Oct 19, 2019

I suggest to revert the direction of this symlink as explained in my comment for light/meson.build below.

@clobrano

This comment has been minimized.

Copy link
Member Author

clobrano commented Oct 20, 2019

I'll fix the symlinking, which are needed to avoid more code duplication while generating both dark and light variants

@dawidd6

This comment has been minimized.

Copy link

dawidd6 commented Oct 20, 2019

Will this change go live on 19.10 when merged?
Because right now having mixed white shell theme with dark gtk one is not a good experience.

Anyway, thanks for doing it!

Both light and dark gnome shell variants are installed under the alt
themes dir (/usr/share/themes/<theme-name>) and the default one (currently
the light one) is symlinked under /usr/share/gnome-shell/theme/<theme-name>.

This implementation is easier to understand than install the two variants in
two different places.

NOTE: consider to refactor variants' meson build scripts because now they are
exactly the same.
@clobrano

This comment has been minimized.

Copy link
Member Author

clobrano commented Oct 20, 2019

Usually there's at least one update of ubuntu packages even in non LTS, so it might

Copy link

memeplex left a comment

LGTM

@clobrano clobrano merged commit df1bade into master Oct 21, 2019
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@ayush987goyal

This comment has been minimized.

Copy link

ayush987goyal commented Oct 21, 2019

Hi @clobrano . How can I use this in the current 19.10 installation?

@DarthWound

This comment has been minimized.

Copy link

DarthWound commented Oct 21, 2019

Will this change go live on 19.10 when merged?
Because right now having mixed white shell theme with dark gtk one is not a good experience.

Usually there's at least one update of ubuntu packages even in non LTS, so it might

Would be great, because even with light GTK theme I don't like the light Shell theme, popup menus "blend" too much into maximized windows, it's less readable for me. I usually prefer a light GTK mixed with a dark Shell. Of course that's just me, but I know a lot of people use the dark GTK and I'm pretty sure having the light Shell is painful for their eyes 😛

@Feichtmeier

This comment has been minimized.

Copy link
Contributor

Feichtmeier commented Oct 21, 2019

We could surely go with a darker tone of white at some point. But then for both gtk and shell popups/popovers.

@clobrano clobrano deleted the issue1483/shell-variant-switch branch Oct 25, 2019
@BloodyIron

This comment has been minimized.

Copy link

BloodyIron commented Nov 5, 2019

How soon before this hits mainline Ubuntu repos already? White Gnome pull-down menus with a dark theme for the rest is pain to the retinas. :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
8 participants
You can’t perform that action at this time.