Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

GNOME Shell theming support #679

Merged
merged 158 commits into from
May 4, 2023
Merged

GNOME Shell theming support #679

merged 158 commits into from
May 4, 2023

Conversation

tfuxu
Copy link
Member

@tfuxu tfuxu commented Dec 23, 2022

Description

THE SHELL THEMING IS REAL!!!

This is it, Shell theming finally comes to Gradience. This means that we only need to add support to additional 420 frameworks and terminal emulators for a "complete GNOME themeing beauty" (sic).

But in all seriousness, this PR brings up shell theming support for GNOME Shell versions 43 and 42. It is WIP, but can be tested already with a majority of available presets (excluding light presets Light presets support was significantly improved in commit 7e9ac2c and can be tested as well).

This PR also introduces a new concept of Theme Engines and improves designs of Theming tab and Preferences window, to make them more readable and expandable.

To-do list:

  • Models for storing shell theme properties
  • Template system for variables insertion
  • Bare-minimum functions for variables insertion, SCSS compiling and theme apply
  • Automatic theme selection (no need to manually recheck Gradience theme in extension)
  • Make SCSS compilation multi-threaded (We don't need that, as libsass is pretty quick at compiling)
  • Recolor Shell panel
  • Recolor Shell palette
  • Convert palette values from GTK to hex/rgba color formats
  • Add support for custom CSS in Advanced tab
  • Check if host has GNOME installed (Needs testing)
  • Make current interface less confusing
  • Copy theme source files to user-writable directory
  • UI for theme manipulation and apply
    • UI for applying shell themes
    • UI for setting custom colors
    • Shell theme apply mechanism in backend code
    • Custom colors insertion mechanism in backend code
  • Shell theme source code in submodules
  • Colored switches (see: Switches from gnome shell not themed with Material You avanisubbiah/material-you-theme#41)
  • Shell theming via command line
  • System-wide theming (Reconsidered for the future releases)
  • Flatpak support

Screenshots

screen-shell-1

Full desktop view with a theme that goes hard

screen-shell-3

OSD widgets properly themed!? No way!

screen-shell-2

Nice

Fixes #618 and GradienceTeam/Plugins#11

Type of change

  • Bugfix (Change which fixes a issue)
  • New feature (Change which adds new functionality)
  • Enhancement (Change which slightly improves existing code)
  • Breaking change (This change will introduce incompatibility with existing functionality)

Warning This PR will require a change in documentation

Changelog

  • Changed Monet section name to Theming
  • GradienceOptionRow widget is now more flexible
  • Make Theming section more modular
  • Added new group in Theming section
  • Renamed settings_schema to preset_schema and moved to frontend/schemas subdir
  • Added new GNOME Shell option in GradienceAppTypeDialog view
  • Created new model module ShellTheme with available manipulation functions

Testing

  • I have tested my changes and verified that they work as expected

How to test the changes

Clone this repo with --recurse-submodules flag: git clone --recurse-submodules https://github.com/GradienceTeam/Gradience.git and switch branches to get into this PR: git checkout shell-theming

Make sure you have User Themes GNOME extension installed (and enabled!), which you should as it is an built-in plugin, but check it nonetheless.

Load a preset you want to generate a theme from. Click on Theming tab in main window, choose in Preset Variant row which color variant is your preset and click Apply button in Shell Engine.

Open User Themes extension settings and check (or recheck) gradience-shell theme. Not needed as of commit 6493453

This commit brings up initial support for GNOME Shell 43 and 42 theming.
Additions in this commit:
* Shell theme generation from preset variables
* Custom preferences group in Theming section (non-functional atm)
* Not much else

Snippets of code are based on code from `material-you-theme` GNOME extension licensed under the terms of the GNU GPLv3 license.
@daudix
Copy link
Member

daudix commented Dec 23, 2022

LFG!!! 🚀 🚀 🚀

(I love the meme'ness of this PR)

@tfuxu tfuxu added this to the 0.8.0 milestone Dec 23, 2022
@0xMRTT
Copy link
Member

0xMRTT commented Dec 29, 2022

Amazing 😎🎉🚀

Thank you very much!

@Neon-44
Copy link

Neon-44 commented Dec 30, 2022

that is fucking awesome and i love it 🥳

also: what extension did you use to move the notification panel to the right?

@daudix
Copy link
Member

daudix commented Dec 30, 2022

@Neon-44

what extension did you use to move the notification panel to the right?

I think this can be done using Just Perfection

Signed-off-by: tfuxu <73042332+tfuxu@users.noreply.github.com>
Signed-off-by: tfuxu <73042332+tfuxu@users.noreply.github.com>
@daudix
Copy link
Member

daudix commented Jan 9, 2023

Why exactly it can't run in flatpak?

@tfuxu
Copy link
Member Author

tfuxu commented Jan 9, 2023

Why exactly it can't run in flatpak?

$ flatpak run com.github.GradienceTeam.Gradience

(process:2): GLib-GIO-ERROR **: 21:44:24.769: Settings schema 'org.gnome.shell.extensions.user-theme' is not installed
** Crash **

@Neon-44
Copy link

Neon-44 commented Jan 10, 2023

can't be fixed with flatseal?

@tfuxu
Copy link
Member Author

tfuxu commented Jan 10, 2023

can't be fixed with flatseal?

Unfortunately, it seems that when Flatpak moved from using DConf for overrides to keyfiles, they disallowed accessing host DConf, so we can't fix this with Flatseal (or overrides more generally speaking).

Full commit changelog:
    * refactored `main_window` module
    * removed 'GNOME Shell' option from `AppTypeDialog` widget
    * changed Shell theming section design, now it's a single `ExpandRow` widget in `PreferencesGroup` parent with an `ActionRow` with a button to 'Custom Shell Colors' window as a child
    * splitted most widget groups in `main_window` module into an external modules
    * disabled `get_default_wallpaper` function in `main_window` module
    * updated POTFILES
@tfuxu
Copy link
Member Author

tfuxu commented Jan 11, 2023

Quick summary of a commit b48add9

Updated Theming tab design:
Screenshot from 2023-01-12 00-49-47

New Custom Theme Color customization window:
Screenshot from 2023-01-12 00-50-05

@daudix
Copy link
Member

daudix commented Jan 11, 2023

Alright, now the UI looks a bit drunk, we now have the colors and theming section, we should do something with this later

@tfuxu
Copy link
Member Author

tfuxu commented Jan 12, 2023

@0xMRTT
Could you create a repository for submodules? Just name it Submodules, as we might later use it for other themes that require variables injection.

@tfuxu tfuxu added the status/wip Work in progress label Jan 13, 2023
@tfuxu tfuxu mentioned this pull request Jan 15, 2023
1 task
@talwat
Copy link

talwat commented Jan 16, 2023

Why exactly it can't run in flatpak?

$ flatpak run com.github.GradienceTeam.Gradience

(process:2): GLib-GIO-ERROR **: 21:44:24.769: Settings schema 'org.gnome.shell.extensions.user-theme' is not installed
** Crash **

Is there a planned way to get around this?

@tfuxu
Copy link
Member Author

tfuxu commented Jan 16, 2023

Is there a planned way to get around this?

Well, I will need to come up with something eventually, because Flatpak users are our biggest demographic, but currently I have no idea how to make it work.

@daudix
Copy link
Member

daudix commented Jan 16, 2023

Maybe system bus access can help?

Can't test myself rn

@tfuxu
Copy link
Member Author

tfuxu commented Jan 16, 2023

Maybe system bus access can help?

You might be onto something, maybe not with system bus, because DConf holds its D-bus calls in session bus, but if it actually allows accessing host DConf that way, we might be able to make use of it here.

@UserrX
Copy link

UserrX commented Apr 30, 2023

Created a github-account just to make this comment :)... I really want to try this out, but I can't get the right version of Gradience or so it seems. I installed gradience-git with yay in Arch and then followed the steps above, but no luck. I don't see the 'Theming' menu nor the 'enable shell theming switch'.

Can someone help me out and do a step by step how to get this version so I can try out the shell theming? I am not new to Linux but not a rockstar either...

@tfuxu
Copy link
Member Author

tfuxu commented Apr 30, 2023

@UserrX
gradience-git package won't have (yet) changes from here, because it fetches source code from main branch, and this PR is in shell-theming branch.

You need to build Gradience manually from source if you want it installed directly on your system (and not as a Flatpak package). To do that, clone repository, checkout to shell-theming branch and setup submodules:

git clone https://github.com/GradienceTeam/Gradience.git
cd Gradience
git fetch
git checkout shell-theming
git submodule update --init --recursive

If you installed gradience-git using yay or other AUR manager, then you don't need to install dependencies.

If not, type this:

pip install -r requirements.txt

and:

sudo pacman -S meson ninja blueprint-compiler python-gobject libsoup libadwaita

Finally, you need to setup build directory and use ninja to "compile" Gradience:

meson setup builddir
meson configure builddir -Dprefix=/usr/local
sudo ninja -C builddir install

@UserrX
Copy link

UserrX commented May 1, 2023

Thank you so much for writing the steps out @tfuxu! That worked great ánd helped me to understand a bit better what is going on.

@tfuxu
Copy link
Member Author

tfuxu commented May 1, 2023

No problem, glad I could help. We might merge this PR today (if I finish adding frontend code for checks), or tomorrow, so pretty soon you'll be able to use gradience-git package again with Shell theming available.

@UserrX
Copy link

UserrX commented May 1, 2023

No problem, glad I could help. We might merge this PR today (if I finish adding frontend code for checks), or tomorrow, so pretty soon you'll be able to use gradience-git package again with Shell theming available.

Would you mind telling me what I have to do when the merge happens?

@tfuxu
Copy link
Member Author

tfuxu commented May 1, 2023

I never used -git packages, but I guess that you'll only need to uninstall manually installed Gradience and install gradience-git using any AUR manager.

To uninstall manually installed Gradience, go to Gradience/ folder (if you haven't removed it yet) and type this:

sudo ninja -C builddir uninstall

@daudix
Copy link
Member

daudix commented May 2, 2023

Something is wrong, I can feel it…

изображение

@daudix
Copy link
Member

daudix commented May 2, 2023

For some reason quick settings menus are not recolored

изображение

@tfuxu
Copy link
Member Author

tfuxu commented May 2, 2023

Probably something new in 44, it looks normal in 43
Screenshot from 2023-05-02 23-16-35

I'll restore them before 0.8.0, but I would like to have them for now removed while setting custom panel color isn't working properly.
@tfuxu
Copy link
Member Author

tfuxu commented May 4, 2023

Okay, everything that was planned for this PR is implemented, and most of the issues have been fixed, so I think we should be ready for merge.
CC @daudix-UFO @0xMRTT Should we merge this now?

@daudix
Copy link
Member

daudix commented May 4, 2023

Yes!

@tfuxu tfuxu merged commit e412a2c into main May 4, 2023
@tfuxu tfuxu deleted the shell-theming branch May 4, 2023 13:24
@tfuxu
Copy link
Member Author

tfuxu commented May 4, 2023

@0xMRTT Remember to add submodules fetching to gradience-git package

@UserrX
Copy link

UserrX commented May 4, 2023

@0xMRTT Remember to add submodules fetching to gradience-git package

Yes. I think this causes an issue at the moment. I removed with the command you suggested, but I'm having issues with installing from gradience-git. Actually Gnome Builder doesn't work either. There is a pygobject dependency error.

I've followed the steps you laid out above, skipping the checkout, thinking that would give me a working install again. Everything seems to install fine, but Gradience won't load.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

feat: GNOME Shell Theming feat: GNOME Shell