feat(oxiced): New stylix to oxiced adapter
This commit is contained in:
parent
d3787c546e
commit
faa8379e25
2 changed files with 59 additions and 6 deletions
|
|
@ -8,9 +8,62 @@
|
||||||
# hence ensure it is by using base16 mkSchemeAttrs
|
# hence ensure it is by using base16 mkSchemeAttrs
|
||||||
base16 = pkgs.callPackage inputs.base16.lib {};
|
base16 = pkgs.callPackage inputs.base16.lib {};
|
||||||
scheme = base16.mkSchemeAttrs config.stylix.base16Scheme;
|
scheme = base16.mkSchemeAttrs config.stylix.base16Scheme;
|
||||||
|
valueOrDefault = value: fallback:
|
||||||
|
if (scheme ? oxiced && scheme.oxiced ? ${value})
|
||||||
|
then scheme.oxiced.value
|
||||||
|
else fallback;
|
||||||
in {
|
in {
|
||||||
xdg.configFile."oxiced/theme.toml" = {
|
xdg.configFile."oxiced/theme.toml" = {
|
||||||
source = (pkgs.formats.toml {}).generate "oxiced" {
|
source = (pkgs.formats.toml {}).generate "oxiced" {
|
||||||
|
base = valueOrDefault "base" scheme.base00;
|
||||||
|
mantle = valueOrDefault "mantle" scheme.base01;
|
||||||
|
primary_bg = valueOrDefault "primary_bg" scheme.base02;
|
||||||
|
secondary_bg = valueOrDefault "secondary_bg" scheme.base03;
|
||||||
|
tertiary_bg = valueOrDefault "tertiary_bg" scheme.base04;
|
||||||
|
text = valueOrDefault "text" scheme.base05;
|
||||||
|
|
||||||
|
primary = valueOrDefault "primary" scheme.base0D;
|
||||||
|
primary_contrast = valueOrDefault "primary_contrast" "FFFFFF";
|
||||||
|
secondary = valueOrDefault "primary" scheme.base07;
|
||||||
|
secondary_contrast = valueOrDefault "secondary_contrast" "FFFFFF";
|
||||||
|
|
||||||
|
good = valueOrDefault "good" scheme.base0B;
|
||||||
|
good_contrast = valueOrDefault "good_contrast" "000000";
|
||||||
|
bad = valueOrDefault "bad" scheme.base08;
|
||||||
|
bad_contrast = valueOrDefault "bad_contrast" "FFFFFF";
|
||||||
|
warning = valueOrDefault "warning" scheme.base0A;
|
||||||
|
warning_contrast = valueOrDefault "warning_contrast" "000000";
|
||||||
|
info = valueOrDefault "info" scheme.base0C;
|
||||||
|
info_contrast = valueOrDefault "info_contrast" "FFFFFF";
|
||||||
|
|
||||||
|
rose = valueOrDefault "rose" scheme.base06;
|
||||||
|
lavender = valueOrDefault "lavender" scheme.base07;
|
||||||
|
blue = valueOrDefault "blue" scheme.base0D;
|
||||||
|
mauve = valueOrDefault "mauve" scheme.base0E;
|
||||||
|
flamingo = valueOrDefault "flamingo" scheme.base0F;
|
||||||
|
|
||||||
|
border_color_weak = valueOrDefault "border_color_weak" scheme.base05;
|
||||||
|
border_color_strong = valueOrDefault "border_color_strong" scheme.base0D;
|
||||||
|
|
||||||
|
tint_amount = valueOrDefault "tint_amound" 0.10;
|
||||||
|
shade_amount = valueOrDefault "shade_amount" 0.05;
|
||||||
|
|
||||||
|
border_radius = valueOrDefault "border_radius" 10;
|
||||||
|
|
||||||
|
padding_xs = valueOrDefault "padding_xs" 4.0;
|
||||||
|
padding_sm = valueOrDefault "padding_sm" 8.0;
|
||||||
|
padding_md = valueOrDefault "padding_md" 12.0;
|
||||||
|
padding_lg = valueOrDefault "padding_lg" 16.0;
|
||||||
|
padding_xl = valueOrDefault "padding_xl" 24.0;
|
||||||
|
padding_xxl = valueOrDefault "padding_xxl" 32.0;
|
||||||
|
|
||||||
|
font_sm = valueOrDefault "font_sm" 10.0;
|
||||||
|
font_md = valueOrDefault "font_md" 14.0;
|
||||||
|
font_lg = valueOrDefault "font_lg" 18.0;
|
||||||
|
font_xl = valueOrDefault "font_xl" 24.0;
|
||||||
|
font_xxl = valueOrDefault "font_xxl" 32.0;
|
||||||
|
|
||||||
|
# legacy compatibility
|
||||||
name = scheme.scheme;
|
name = scheme.scheme;
|
||||||
base00 = scheme.base00;
|
base00 = scheme.base00;
|
||||||
base01 = scheme.base01;
|
base01 = scheme.base01;
|
||||||
|
|
|
||||||
|
|
@ -32,8 +32,6 @@ in {
|
||||||
example = {
|
example = {
|
||||||
# custom tokyo night
|
# custom tokyo night
|
||||||
base00 = "1A1B26";
|
base00 = "1A1B26";
|
||||||
# base01 = "16161E";
|
|
||||||
# base01 = "15161e";
|
|
||||||
base01 = "191a25";
|
base01 = "191a25";
|
||||||
base02 = "2F3549";
|
base02 = "2F3549";
|
||||||
base03 = "444B6A";
|
base03 = "444B6A";
|
||||||
|
|
@ -46,10 +44,6 @@ in {
|
||||||
base0A = "0DB9D7";
|
base0A = "0DB9D7";
|
||||||
base0B = "9ECE6A";
|
base0B = "9ECE6A";
|
||||||
base0C = "B4F9F8";
|
base0C = "B4F9F8";
|
||||||
# base0D = "2AC3DE";
|
|
||||||
# base0D = "A9B1D6";
|
|
||||||
# base0D = "62A0EA";
|
|
||||||
# base0D = "779EF1";
|
|
||||||
base0D = "366fea";
|
base0D = "366fea";
|
||||||
base0E = "BB9AF7";
|
base0E = "BB9AF7";
|
||||||
base0F = "F7768E";
|
base0F = "F7768E";
|
||||||
|
|
@ -65,6 +59,12 @@ in {
|
||||||
Can be an attribute set with base00 to base0F,
|
Can be an attribute set with base00 to base0F,
|
||||||
a string that leads to a yaml file in base16-schemes path,
|
a string that leads to a yaml file in base16-schemes path,
|
||||||
or a path to a custom yaml file.
|
or a path to a custom yaml file.
|
||||||
|
|
||||||
|
Also supports the oxiced theme in an oxiced attrset.
|
||||||
|
oxiced = {
|
||||||
|
# and more
|
||||||
|
primary = "#yourcolor";
|
||||||
|
};
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
cursor = lib.mkOption {
|
cursor = lib.mkOption {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue