Gerg-L / spicetify-nix

A nix flake for configuring spicetify. Includes packaging for many popular themes and extensions.
GNU General Public License v3.0
110 stars 13 forks source link

Feature request: Pywal ~ Hot color switching #222

Closed Arqamz closed 1 month ago

Arqamz commented 1 month ago

Im not sure if this is just a nix issue. The wiki does mention this is supported image

On nixos to change color.ini in my theme doesnt change anything. Here is how I've installed spicetify image

gigamonster256 commented 1 month ago

It seems like it is supported, you would need to define customColorScheme in your spicetify configuration and build it up as an attribute set mapping the thing you want to color (things like text/subtext in the example you gave) to the correct Xresources color (background, foreground, etc)

Arqamz commented 1 month ago

Could you tell me where exactly I need to define customColorScheme. I have this color.ini but Im not sure exactly where in my nixos configuration for building spicetify I need to add this.

[Base]
main_fg                               = ${xrdb:color3}
secondary_fg                          = ${xrdb:color6}
main_bg                               = ${xrdb:color0}
sidebar_and_player_bg                 = ${xrdb:color0}
cover_overlay_and_shadow              = 000000
indicator_fg_and_button_bg            = ${xrdb:color3}
pressing_fg                           =  FF5C86
slider_bg                             = ${xrdb:color1}
sidebar_indicator_and_hover_button_bg = ${xrdb:color2}
scrollbar_fg_and_selected_row_bg      = ${xrdb:color5}
pressing_button_fg                    = ${xrdb:color6}
pressing_button_bg                    = ${xrdb:color4}
selected_button                       = ${xrdb:color2}
miscellaneous_bg                      = ${xrdb:color1}
miscellaneous_hover_bg                = ${xrdb:color4}
preserve_1                            = FFFFFF

An example snippet would be extremely helpful thank you

Gerg-L commented 1 month ago

under programs.spicetify

colorScheme = "custom";
customColorScheme = {
 #translated ini values
};

Also https://github.com/NotAShelf/Basix https://github.com/Misterio77/nix-colors https://github.com/arcnmx/base16.nix One of these may help

NotAShelf commented 1 month ago

https://github.com/NotAShelf/Basix is clearly superior :trollface:

(unironically)

Arqamz commented 1 month ago

@Gerg-L after hacking away for far too long I haven't been able to figure it out. Could you please look into the issue again and confirm if I really basix? @NotAShelf suggested that using toINI should work aswelll. But it doesnt look like it. Could you provide me with the exact snippet, I just want my pywal colors to work on spicetify.

image image Both these and various other tweaks involving extra speech marks or less of them aren't working.

error: A definition for option `programs.spicetify.customColorScheme.base' is not of type `string'. Definition values:
       - In `/etc/nixos/imports/user.nix':
           {
             cover_overlay_and_shadow = "000000";
             indicator_fg_and_button_bg = "xrdb:color3";
             main_bg = "xrdb:color0";
             main_fg = "xrdb:color3";
           ...

Would you be so kind as to provide me with an actual snippet based on what I've showed you.

NotAShelf commented 1 month ago

FYI I've never actually used a custom colorscheme with spicetify. My suggestion to use toINI was based on Gerg's comment:

under programs.spicetify

colorScheme = "custom";
customColorScheme = {
#translated ini values
};

Based on the error, I'd assume you do not need toINI - but just an attribute set of strings, e.g.,


customColorScheme = {
   foo = "bar";
   baz = "qux";
};
Arqamz commented 1 month ago

@Gerg-L image

Trying to use xrdb is failing for me, I've added xorg.xrdb to both my environment packages and my user packages but it still doesnt seem to work

Here's my config image

Gerg-L commented 1 month ago

does xrdb colors work with spicetify on non-nixos?

Arqamz commented 1 month ago

does xrdb colors work with spicetify on non-nixos?

I would hope so, it's in the official spicetify documentation.

image

Gerg-L commented 1 month ago

after messing around with this a bit, using xrdb values is not possible while building inside the nix sandbox because spicetify needs the xrdb values to be present at build time. which would make using them pointless.

so I recommend using one of the previously mentioned nix color frameworks and setting all your color values that way for consistent theming across applications