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

feat: Light/Dark Presets #12

Closed
radical4ever opened this issue Jul 22, 2022 · 51 comments
Closed

feat: Light/Dark Presets #12

radical4ever opened this issue Jul 22, 2022 · 51 comments
Labels
area/preset enhancement New feature or request help wanted Extra attention is needed status/wontfix This will not be worked on

Comments

@radical4ever
Copy link

It would be great if there is an option for applying the settings on both light/dark theme, bc when i edit the theme it just applies it for one theme and makes dark mode not working

@ArtyIF
Copy link
Contributor

ArtyIF commented Jul 22, 2022 via email

@ArtyIF ArtyIF added the enhancement New feature or request label Jul 22, 2022
@ArtyIF
Copy link
Contributor

ArtyIF commented Jul 22, 2022

Since my other email didn't get sent here for some reason - yes, it's possible. Noted.

@radical4ever
Copy link
Author

i leave you my gtk.css file that i use for that:
@define-color accent_color @green_4;
@define-color accent_bg_color @green_4;
@define-color window_bg_color;
@define-color window_fg_color;
@define-color headerbar_bg_color;
@define-color headerbar_fg_color;
@define-color popover_bg_color;
@define-color popover_fg_color;
@define-color view_bg_color;
@define-color view_fg_color;
@define-color card_bg_color rgba(255, 255, 255, 0.08);
@define-color

and it works both with adw-gtk3 theme just paste the same file over gtk-3.0

@ArtyIF
Copy link
Contributor

ArtyIF commented Jul 22, 2022

In the meantime copy the gtk.css in gtk-4.0 and gtk-3.0 and rename it gtk-dark.css, that should work

@radical4ever
Copy link
Author

Yup, that works for now!

@ArtyIF
Copy link
Contributor

ArtyIF commented Jul 22, 2022

Wait, why would it do that for you? It doesn't for me. It always applies the same theme regardless of the color scheme chosen.

@ArtyIF
Copy link
Contributor

ArtyIF commented Jul 22, 2022

Are you copying those CSS files into your theme or something? Because this program doesn't change the theme files, it just copies the parameters to ~/.config/gtk-4.0/gtk.css (or 3.0 for gtk3). That file is always applied about the selected theme or app's theme (unless the app sets the priority higher like I do, which is technically not recommended) no matter the chosen color scheme.

@ArtyIF ArtyIF added status/more-info-needed Further information is requested and removed enhancement New feature or request labels Jul 22, 2022
@radical4ever
Copy link
Author

Are you copying those CSS files into your theme or something? Because this program doesn't change the theme files, it just copies the parameters to ~/.config/gtk-4.0/gtk.css (or 3.0 for gtk3). That file is always applied about the selected theme or app's theme (unless the app sets the priority higher like I do, which is technically not recommended) no matter the chosen color scheme.

i dont use a theme or something else, i just add the parameters for the accent color and the rest i leave it empy (so it uses the default value) and then i just save it in ~/.config/gtk-4.0 or gtk-3.0, so it always use the same color on all apps.

@radical4ever
Copy link
Author

just save it as gtk.css and put it in gtk-4.0 and that should work on libadwaita apps and for adw-gtk3 i do the same and restart the gtk3 apps

@ArtyIF
Copy link
Contributor

ArtyIF commented Jul 22, 2022 via email

@ArtyIF
Copy link
Contributor

ArtyIF commented Jul 22, 2022

just save it as gtk.css and put it in gtk-4.0 and that should work on libadwaita apps and for adw-gtk3 i do the same and restart the gtk3 apps

It's supposed to automatically get put in gtk-4.0 and gtk-3.0.

@radical4ever
Copy link
Author

just save it as gtk.css and put it in gtk-4.0 and that should work on libadwaita apps and for adw-gtk3 i do the same and restart the gtk3 apps

It's supposed to automatically get put in gtk-4.0 and gtk-3.0.

oh, sorry! i was talking about the gtk.css file i mentioned earlyer that i made

i leave you my gtk.css file that i use for that: @define-color accent_color @green_4; @define-color accent_bg_color @green_4; @define-color window_bg_color; @define-color window_fg_color; @define-color headerbar_bg_color; @define-color headerbar_fg_color; @define-color popover_bg_color; @define-color popover_fg_color; @define-color view_bg_color; @define-color view_fg_color; @define-color card_bg_color rgba(255, 255, 255, 0.08); @define-color

it just with this one that i made that i dont have the issue but when the app makes its own makes one with only the light theme set.

@ArtyIF
Copy link
Contributor

ArtyIF commented Jul 22, 2022 via email

@radical4ever
Copy link
Author

yeah i know that, but what i mean is that if its possible to made an option to apply both light/dark theme like that.

@ArtyIF
Copy link
Contributor

ArtyIF commented Jul 22, 2022

yeah i know that, but what i mean is that if its possible to made an option to apply both light/dark theme like that.

Like, apply separate color schemes for light and dark themes? Not yet.

@radical4ever
Copy link
Author

yeah i know that, but what i mean is that if its possible to made an option to apply both light/dark theme like that.

Like, apply separate color schemes for light and dark themes? Not yet.

not separate, i mean like, an only color for both light/dark theme, without going to edit the 2 themes separately and with that you could switch between theme.

@radical4ever
Copy link
Author

maybe i have to make a video to better explain myself 😅🤣

@radical4ever
Copy link
Author

this is what i'm trying to mean (i couldnt make a video it stops when i change it)
Captura desde 2022-07-22 18-13-13

@ArtyIF
Copy link
Contributor

ArtyIF commented Jul 22, 2022 via email

@radical4ever
Copy link
Author

Same theme for light and dark? It already does that

i mean like an option to apply the colors without doing the same thing on the dark variant

@ArtyIF
Copy link
Contributor

ArtyIF commented Jul 23, 2022

Okay I think I understood what you mean. Have one preset for both light and dark theme so you didn't have to apply a different color scheme when you change the theme. Is that right?

@ArtyIF
Copy link
Contributor

ArtyIF commented Jul 23, 2022

As in, one preset has a variant for light and dark theme, and when applying the scheme, you're still able to switch between light and dark without reapplying the scheme.

@radical4ever
Copy link
Author

Okay I think I understood what you mean. Have one preset for both light and dark theme so you didn't have to apply a different color scheme when you change the theme. Is that right?

Yes, is that

@radical4ever
Copy link
Author

As in, one preset has a variant for light and dark theme, and when applying the scheme, you're still able to switch between light and dark without reapplying the scheme.

Yeah, something like that

@ArtyIF ArtyIF added enhancement New feature or request help wanted Extra attention is needed and removed status/more-info-needed Further information is requested labels Jul 24, 2022
@daudix
Copy link
Member

daudix commented Sep 14, 2022

👌

@daudix
Copy link
Member

daudix commented Sep 14, 2022

Done!

@daudix daudix modified the milestones: 0.3.0, 0.4.0 Sep 25, 2022
@0xMRTT 0xMRTT added the hacktoberfest Let's hacktoberfest label Oct 2, 2022
@daudix
Copy link
Member

daudix commented Oct 6, 2022

I've not tested this, but here's how it could be done.

1. Create 2 files containing the light and dark themes. For example: `gtk-light.css` and `gtk-dark.css`.

2. Detect if `gsettings set org.gnome.desktop.interface color-scheme` is set to `'default'` or `'dark'`.

3. If set to dark then symlink `gtk-dark.css` to `gtk.css`, and if default symlink the other file.

What about trying to do this?

@daudix
Copy link
Member

daudix commented Oct 6, 2022

@daudix daudix pinned this issue Oct 6, 2022
@0xMRTT
Copy link
Member

0xMRTT commented Oct 6, 2022

The theme idea is the best one because with this idea, we will be able to customise GNOME shell

@daudix
Copy link
Member

daudix commented Oct 6, 2022

Good, one more task for 0.4.0 👍

@ArtyIF
Copy link
Contributor

ArtyIF commented Oct 11, 2022 via email

@0xMRTT
Copy link
Member

0xMRTT commented Oct 11, 2022

I'm working on this because it's related to #618

@0xMRTT 0xMRTT linked a pull request Oct 19, 2022 that will close this issue
29 tasks
@tfuxu tfuxu removed the hacktoberfest Let's hacktoberfest label Dec 2, 2022
@daudix daudix changed the title feat: light/dark presets feat: Light/Dark Presets Dec 9, 2022
@tfuxu tfuxu removed a link to a pull request Dec 13, 2022
@tfuxu tfuxu removed this from the 0.4.0 milestone Dec 23, 2022
@tfuxu tfuxu removed a link to a pull request Dec 25, 2022
29 tasks
@lutzseverino
Copy link

How is this going along? This problem should be a priority, since some people switch themes quite often. Night Theme Switcher is rendered useless with Gradience if this persists.

@ArtyIF
Copy link
Contributor

ArtyIF commented Jan 25, 2023

I think this can be worked around by generating two files for light and dark and creating a GApplication that'll switch the gtk.css file periodically. At least, until the recoloring API becomes a thing in the stable version

@daudix
Copy link
Member

daudix commented Jan 25, 2023

The problem is that you still need to restart the app, and apps like nautilus will need to be killed every time

@tfuxu tfuxu added status/wontfix This will not be worked on area/preset labels Jan 30, 2023
@tfuxu
Copy link
Member

tfuxu commented Jan 31, 2023

With current libadwaita implementation of custom themes (or more accurately, a lack of it), it is impossible to add support for seamless transitions between light/dark presets. As noted by daudix, every currently running GTK application on user's system would need to be restarted, or ideally the whole DE session would need to be restarted, making the whole feature very clunky to use.

I'm closing and locking this issue for now, as until AdwColorTheme and its recoloring API becomes available, the discussion here will lead to nothing.
If you found some method that could be used / GNOME Team has added some other sort of support for this and we didn't noticed yet, it would be really appreciated if you inform us of your findings on Matrix or on Discussions.

@tfuxu tfuxu closed this as not planned Won't fix, can't repro, duplicate, stale Jan 31, 2023
@GradienceTeam GradienceTeam locked and limited conversation to collaborators Jan 31, 2023
@daudix daudix unpinned this issue Jan 31, 2023
@daudix daudix pinned this issue Jan 31, 2023
@0xMRTT 0xMRTT unpinned this issue Jul 12, 2023
@daudix daudix pinned this issue Sep 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/preset enhancement New feature or request help wanted Extra attention is needed status/wontfix This will not be worked on
Projects
Status: Done
Development

No branches or pull requests

8 participants