GradienceTeam / Gradience

Change the look of Adwaita, with ease
https://gradienceteam.github.io
GNU General Public License v3.0
1.3k stars 48 forks source link

bug: Presets without 5 colors per palette don't apply the shell theme on GNOME 45 #825

Open ThatOneCalculator opened 11 months ago

ThatOneCalculator commented 11 months ago

Is there an existing issue for this?

What happened?

When applying the shell theme, the success toast appears but the theme doesn't apply to the shell, and an error occurs in the console.

Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/gradience/backend/theming/shell.py", line 130, in _apply_theme_thread
    output = self.apply_theme(source_object, theme_variant, preset)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/gradience/backend/theming/shell.py", line 142, in apply_theme
    self._create_theme(parent, preset)
  File "/usr/lib/python3.11/site-packages/gradience/backend/theming/shell.py", line 155, in _create_theme
    self._insert_variables()
  File "/usr/lib/python3.11/site-packages/gradience/backend/theming/shell.py", line 176, in _insert_variables
    line = line.replace("{{" + _key + "}}", self.preset_palette[prefix + '_'][key])
                                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^
KeyError: '4'

To Reproduce

  1. Apply theme
  2. Apply shell theme

Expected behavior

Shell theme applies

Screenshots

No response

OS

Arch Linux

DE/WM version

GNOME 45.0

Version

main branch (gradience-git from aur)

Installation method

AUR

Enabled system extensions (GNOME specific)

user-theme@gnome-shell-extensions.gcampax.github.com
screenshot-window-sizer@gnome-shell-extensions.gcampax.github.com
dash-to-dock@micxgx.gmail.com
grand-theft-focus@zalckos.github.com
no-overview@fthx
appindicatorsupport@rgcjonas.gmail.com
drive-menu@gnome-shell-extensions.gcampax.github.com
dim-completed-calendar-events@marcinjahn.com
favourites-in-appgrid@harshadgavali.gitlab.org
battery-indicator-icon@Deminder
just-perfection-desktop@just-perfection
auto-move-windows@gnome-shell-extensions.gcampax.github.com
quicksettings-audio-devices-renamer@marcinjahn.com
firefox-pip@bennypowers.com
clipboard-indicator@tudmotu.com
quick-touchpad-toggle@kramo.hu
blur-my-shell@aunetx
caffeine@patapon.info
do-not-disturb-while-screen-sharing-or-recording@marcinjahn.com
app-hider@lynith.dev
logomenu@aryan_k

Additional context

No response

Code of Conduct

github-actions[bot] commented 11 months ago

Welcome on Gradience. 🥳 We really appreciate your contribution. The core team will review your issue as soon as possible. You can also join the Matrix room: https://matrix.to/#/#Gradience-space:envs.net or the Discord server: https://discord.com/invite/4njFDtfGEZ

Ryuuramaru commented 11 months ago

Can confirm this issue happens on Fedora 39 Pre-Release (With GNOME 45), with Gradience installed via Flathub

0xMRTT commented 11 months ago

Can you tell me which preset are you using ?

ThatOneCalculator commented 11 months ago

Rose Pine. It actually works fine with Pretty Purple, interestingly

ThatOneCalculator commented 11 months ago

The Catppuchin themes work too

ThatOneCalculator commented 11 months ago

Actually, it seems that almost all themes besides the Rose Pine ones work. I wonder if it's because it has an accent in its name... Nope, that wasn't the cause. Something in those themes are broken.

0xMRTT commented 11 months ago

@ThatOneCalculator no the issue is that your palette isn't complete ...

0xMRTT commented 11 months ago

each color needs to have 5 sub colors, whereas rose pine only has 3 sub colors per color

0xMRTT commented 11 months ago

This is why it says 4 as an error

ThatOneCalculator commented 11 months ago

Ref: https://github.com/GradienceTeam/Community/pull/105

ThatOneCalculator commented 11 months ago

I think this issue should still be open, as the bug itself isn't gone, the theme without 5 colors was fixed. Themes with less than 5 colors per category should probably autofill the remaining missing colors with the color that came before it to prevent confusion.

Ryuuramaru commented 11 months ago

On my end the issue occurs with any of the included themes. This is a pic after applying Pretty Purple and logging out and back in.

image

This is one of the settings menu.

image

0xMRTT commented 11 months ago

@Ryuuramaru which version of Gradience are you using ? And can you try to apply from gradience launched from CLI and send me the logs ?

0xMRTT commented 11 months ago

I think this issue should still be open, as the bug itself isn't gone, the theme without 5 colors was fixed. Themes with less than 5 colors per category should probably autofill the remaining missing colors with the color that came before it to prevent confusion.

Yeah it should :)

Ryuuramaru commented 11 months ago

@Ryuuramaru which version of Gradience are you using ? And can you try to apply from gradience launched from CLI and send me the logs ?

Version 0.4.1

This is the console output: (Is this what you wanted? I couldn't find any logs)

ryuu-fedora@fedora:~$ flatpak run --command=gradience-cli com.github.GradienceTeam.Gradience apply -n "Catppuccin Frappé" [Gradience] INFO: Preset Catppuccin Frappé applied successfully for Gtk4 applications. [Gradience] INFO: In order for changes to take full effect, you need to log out.

0xMRTT commented 11 months ago

@Ryuuramaru which version of Gradience are you using ? And can you try to apply from gradience launched from CLI and send me the logs ?

Version 0.4.1

This is the console output: (Is this what you wanted? I couldn't find any logs)

ryuu-fedora@fedora:~$ flatpak run --command=gradience-cli com.github.GradienceTeam.Gradience apply -n "Catppuccin Frappé" [Gradience] INFO: Preset Catppuccin Frappé applied successfully for Gtk4 applications. [Gradience] INFO: In order for changes to take full effect, you need to log out.

Shell Theming isn't available in 0.4.1 ...

Ryuuramaru commented 11 months ago

Sorry!

I had assumed that since it is a Flatpak (and thus not subject to not being updated in the Fedora Repos), it would incorporate changes from 10 months ago. Looking closer at it, it is stated for a 0.8 milestone so yeah, should've really saw that before posting.

rstanuwijaya commented 10 months ago

Do you still have the sidebar not correctly themed after updating to 0.8? I have a similar issue as yours, but partially fixed. The left side top panel does not seem to be themed properly.

image