Gradience icon indicating copy to clipboard operation
Gradience copied to clipboard

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

Open ThatOneCalculator opened this issue 2 years ago • 18 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

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)

[email protected]
screenshot-window-sizer@gnome-shell-extensions.gcampax.github.com
[email protected]
[email protected]
no-overview@fthx
[email protected]
[email protected]
[email protected]
[email protected]
battery-indicator-icon@Deminder
just-perfection-desktop@just-perfection
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
blur-my-shell@aunetx
[email protected]
[email protected]
[email protected]
logomenu@aryan_k

Additional context

No response

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

ThatOneCalculator avatar Sep 27 '23 21:09 ThatOneCalculator

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

github-actions[bot] avatar Sep 27 '23 21:09 github-actions[bot]

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

Ryuuramaru avatar Sep 28 '23 17:09 Ryuuramaru

Can you tell me which preset are you using ?

0xMRTT avatar Sep 28 '23 18:09 0xMRTT

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

ThatOneCalculator avatar Sep 28 '23 18:09 ThatOneCalculator

The Catppuchin themes work too

ThatOneCalculator avatar Sep 28 '23 18:09 ThatOneCalculator

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.

ThatOneCalculator avatar Sep 28 '23 18:09 ThatOneCalculator

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

0xMRTT avatar Sep 28 '23 18:09 0xMRTT

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

0xMRTT avatar Sep 28 '23 18:09 0xMRTT

This is why it says 4 as an error

0xMRTT avatar Sep 28 '23 18:09 0xMRTT

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

ThatOneCalculator avatar Sep 28 '23 18:09 ThatOneCalculator

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.

ThatOneCalculator avatar Sep 29 '23 00:09 ThatOneCalculator

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

Ryuuramaru avatar Sep 29 '23 10:09 Ryuuramaru

@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 avatar Sep 29 '23 17:09 0xMRTT

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 :)

0xMRTT avatar Sep 29 '23 17:09 0xMRTT

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

Ryuuramaru avatar Sep 29 '23 18:09 Ryuuramaru

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

0xMRTT avatar Sep 29 '23 18:09 0xMRTT

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.

Ryuuramaru avatar Sep 29 '23 18:09 Ryuuramaru

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

rstanuwijaya avatar Oct 03 '23 03:10 rstanuwijaya