Gradience icon indicating copy to clipboard operation
Gradience copied to clipboard

feat: light/dark presets

Open radical4ever opened this issue 3 years ago • 41 comments
trafficstars

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

radical4ever avatar Jul 22 '22 15:07 radical4ever

Is it possible to do that though with gtk.css? Let me check.

On Fri, Jul 22 2022 at 08:10:21 AM -0700, Radical4ever @.***> wrote:

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

— Reply to this email directly, view it on GitHub https://github.com/ArtyIF/AdwCustomizer/issues/12, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB5FPQQS434VDVJDETWH6C3VVK2V3ANCNFSM54L4SRYQ. You are receiving this because you are subscribed to this thread.Message ID: @.***>

ArtyIF avatar Jul 22 '22 15:07 ArtyIF

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

ArtyIF avatar Jul 22 '22 15:07 ArtyIF

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

radical4ever avatar Jul 22 '22 15:07 radical4ever

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

ArtyIF avatar Jul 22 '22 15:07 ArtyIF

Yup, that works for now!

radical4ever avatar Jul 22 '22 15:07 radical4ever

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 avatar Jul 22 '22 16:07 ArtyIF

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 avatar Jul 22 '22 16:07 ArtyIF

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 avatar Jul 22 '22 17:07 radical4ever

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

radical4ever avatar Jul 22 '22 17:07 radical4ever

And it doesn't apply when you have it set to dark, right?

On Fri, Jul 22 2022 at 10:29:16 AM -0700, Radical4ever @.***> wrote:

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.

— Reply to this email directly, view it on GitHub https://github.com/ArtyIF/AdwCustomizer/issues/12#issuecomment-1192791013, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB5FPQUETYOFTJCFFUBUW3DVVLK6ZANCNFSM54L4SRYQ. You are receiving this because you commented.Message ID: @.***>

ArtyIF avatar Jul 22 '22 17:07 ArtyIF

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.

ArtyIF avatar Jul 22 '22 17:07 ArtyIF

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.

radical4ever avatar Jul 22 '22 17:07 radical4ever

Ohhhhh. You can change the accent color like that in the app. Press the pencil icon next to the needed values (Accent Standalone Color and Accent Background Color in this case) and enter @green_4. If you want to use a dark theme, use the dropdown in the top to select the dark preset (do it before the @green_4 thing).

On Fri, Jul 22 2022 at 10:36:27 AM -0700, Radical4ever @.***> wrote:

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.

— Reply to this email directly, view it on GitHub https://github.com/ArtyIF/AdwCustomizer/issues/12#issuecomment-1192796200, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB5FPQQTJGKP5QTFSUAJHODVVLLZXANCNFSM54L4SRYQ. You are receiving this because you commented.Message ID: @.***>

ArtyIF avatar Jul 22 '22 17:07 ArtyIF

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.

radical4ever avatar Jul 22 '22 18:07 radical4ever

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.

ArtyIF avatar Jul 22 '22 18:07 ArtyIF

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 avatar Jul 22 '22 21:07 radical4ever

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

radical4ever avatar Jul 22 '22 21:07 radical4ever

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

radical4ever avatar Jul 22 '22 21:07 radical4ever

Same theme for light and dark? It already does that.00:09, July 23, 2022, Radical4ever @.***>:

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.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***> -- Sent from Yandex Mail for mobile

ArtyIF avatar Jul 22 '22 23:07 ArtyIF

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

radical4ever avatar Jul 23 '22 02:07 radical4ever

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 avatar Jul 23 '22 09:07 ArtyIF

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.

ArtyIF avatar Jul 23 '22 09:07 ArtyIF

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 avatar Jul 23 '22 12:07 radical4ever

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

radical4ever avatar Jul 23 '22 12:07 radical4ever

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.

lassekongo83 avatar Jul 27 '22 05:07 lassekongo83

I believe Libadwaita has a built-in function for detecting the color scheme. Also it won't change the theme automatically when you toggle it in system settings, so it's not that much different from how it works now.

ArtyIF avatar Jul 27 '22 05:07 ArtyIF

I believe Libadwaita has a built-in function for detecting the color scheme. Also it won't change the theme automatically when you toggle it in system settings, so it's not that much different from how it works now.

I have done GTK3 auto-switch using Night Theme Switcher extension

image

daudix avatar Jul 28 '22 14:07 daudix

No, I mean that if in system settings you switch to Light theme when you have a dark color scheme applied, currently the color scheme won't change to light.

On Thu, Jul 28 2022 at 07:42:18 AM -0700, David Lapshin @.***> wrote:

I believe Libadwaita has a built-in function for detecting the color scheme. Also it won't change the theme automatically when you toggle it in system settings, so it's not that much different from how it works now.

I have done GTK3 auto-switch using Night Theme Switcher https://nightthemeswitcher.romainvigier.fr/ extension

— Reply to this email directly, view it on GitHub https://github.com/ArtyIF/AdwCustomizer/issues/12#issuecomment-1198237744, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB5FPQRWMQHM5SG37TUUU5TVWKL4VANCNFSM54L4SRYQ. You are receiving this because you commented.Message ID: @.***>

ArtyIF avatar Jul 28 '22 14:07 ArtyIF

I mean something like this, in case you don't mean that already (all Libadwaita apps):

ezgif com-gif-maker

ArtyIF avatar Jul 28 '22 15:07 ArtyIF

That happens when you apply custom CSS with AdwCustomizer

daudix avatar Jul 28 '22 15:07 daudix

And when you reset CSS, everything works again

daudix avatar Jul 28 '22 15:07 daudix

image

0xMRTT avatar Aug 11 '22 16:08 0xMRTT

I see that this issue was marked as completed. In that case, how do I make use of light and dark modes using the preset themes? It seems like I have an option to select and apply one of the two, but this seems to break the "Light" and "Dark" functionality in Gnome Settings.

cachandlerdev avatar Sep 03 '22 18:09 cachandlerdev

Hi @cachandlerdev

For some reason, Adwaita and Gtk are ignoring gtk-dark.css, so i've disabled this functionnality. This will come back very soon :rocket:

0xMRTT avatar Sep 03 '22 18:09 0xMRTT