From 547fe3ef658c71ba9192d1a3c6cbe6355022f416 Mon Sep 17 00:00:00 2001 From: DwarfMaster Date: Tue, 14 Mar 2023 16:21:51 +0100 Subject: [PATCH 1/3] Add bat support --- modules/bat/base16-stylix.mustache | 538 +++++++++++++++++++++++++++++ modules/bat/hm.nix | 17 + 2 files changed, 555 insertions(+) create mode 100644 modules/bat/base16-stylix.mustache create mode 100644 modules/bat/hm.nix diff --git a/modules/bat/base16-stylix.mustache b/modules/bat/base16-stylix.mustache new file mode 100644 index 0000000..cdcd941 --- /dev/null +++ b/modules/bat/base16-stylix.mustache @@ -0,0 +1,538 @@ + + + + + author + Template: Chris Kempson, Scheme: Mitchell Kember + name + Base16 Stylix + colorSpaceName + sRGB + settings + + + settings + + background + #{{base00-hex}} + caret + #{{base05-hex}} + foreground + #{{base05-hex}} + invisibles + #{{base03-hex}} + lineHighlight + #{{base03-hex}} + selection + #{{base02-hex}} + gutter + #{{base01-hex}} + gutterForeground + #{{base03-hex}} + + + + name + Text + scope + variable.parameter.function + settings + + foreground + #{{base05-hex}} + + + + name + Comments + scope + comment, punctuation.definition.comment + settings + + foreground + #{{base03-hex}} + + + + name + Punctuation + scope + punctuation.definition.string, punctuation.definition.variable, punctuation.definition.string, punctuation.definition.parameters, punctuation.definition.string, punctuation.definition.array + settings + + foreground + #{{base05-hex}} + + + + name + Delimiters + scope + none + settings + + foreground + #{{base05-hex}} + + + + name + Operators + scope + keyword.operator + settings + + foreground + #{{base05-hex}} + + + + name + Keywords + scope + keyword + settings + + foreground + #{{base0E-hex}} + + + + name + Variables + scope + variable + settings + + foreground + #{{base05-hex}} + + + + name + Functions + scope + entity.name.function, meta.require, support.function.any-method + settings + + foreground + #{{base0D-hex}} + + + + name + Labels + scope + entity.name.label + settings + + foreground + #{{base0F-hex}} + + + + name + Classes + scope + support.class, entity.name.class, entity.name.type.class + settings + + foreground + #{{base0A-hex}} + + + + name + Classes + scope + meta.class + settings + + foreground + #{{base07-hex}} + + + + name + Methods + scope + keyword.other.special-method + settings + + foreground + #{{base0D-hex}} + + + + name + Storage + scope + storage + settings + + foreground + #{{base0E-hex}} + + + + name + Support + scope + support.function + settings + + foreground + #{{base0C-hex}} + + + + name + Strings, Inherited Class + scope + string, constant.other.symbol, entity.other.inherited-class + settings + + foreground + #{{base0B-hex}} + + + + name + Integers + scope + constant.numeric + settings + + foreground + #{{base09-hex}} + + + + name + Floats + scope + none + settings + + foreground + #{{base09-hex}} + + + + name + Boolean + scope + none + settings + + foreground + #{{base09-hex}} + + + + name + Constants + scope + constant + settings + + foreground + #{{base09-hex}} + + + + name + Tags + scope + entity.name.tag + settings + + foreground + #{{base08-hex}} + + + + name + Attributes + scope + entity.other.attribute-name + settings + + foreground + #{{base09-hex}} + + + + name + Attribute IDs + scope + entity.other.attribute-name.id, punctuation.definition.entity + settings + + foreground + #{{base0D-hex}} + + + + name + Selector + scope + meta.selector + settings + + foreground + #{{base0E-hex}} + + + + name + Values + scope + none + settings + + foreground + #{{base09-hex}} + + + + name + Headings + scope + markup.heading punctuation.definition.heading, entity.name.section + settings + + fontStyle + + foreground + #{{base0D-hex}} + + + + name + Units + scope + keyword.other.unit + settings + + foreground + #{{base09-hex}} + + + + name + Bold + scope + markup.bold, punctuation.definition.bold + settings + + fontStyle + bold + foreground + #{{base0A-hex}} + + + + name + Italic + scope + markup.italic, punctuation.definition.italic + settings + + fontStyle + italic + foreground + #{{base0E-hex}} + + + + name + Code + scope + markup.raw.inline + settings + + foreground + #{{base0B-hex}} + + + + name + Link Text + scope + string.other.link, punctuation.definition.string.end.markdown, punctuation.definition.string.begin.markdown + settings + + foreground + #{{base08-hex}} + + + + name + Link Url + scope + meta.link + settings + + foreground + #{{base09-hex}} + + + + name + Quotes + scope + markup.quote + settings + + foreground + #{{base09-hex}} + + + + name + Separator + scope + meta.separator + settings + + background + #{{base02-hex}} + foreground + #{{base05-hex}} + + + + name + Inserted + scope + markup.inserted + settings + + foreground + #{{base0B-hex}} + + + + name + Deleted + scope + markup.deleted + settings + + foreground + #{{base08-hex}} + + + + name + Changed + scope + markup.changed + settings + + foreground + #{{base0E-hex}} + + + + name + Colors + scope + constant.other.color + settings + + foreground + #{{base0C-hex}} + + + + name + Regular Expressions + scope + string.regexp + settings + + foreground + #{{base0C-hex}} + + + + name + Escape Characters + scope + constant.character.escape + settings + + foreground + #{{base0C-hex}} + + + + name + Embedded + scope + punctuation.section.embedded, variable.interpolation + settings + + foreground + #{{base0E-hex}} + + + + name + Illegal + scope + invalid.illegal + settings + + background + #{{base08-hex}} + foreground + #{{base07-hex}} + + + + name + Broken + scope + invalid.broken + settings + + background + #{{base09-hex}} + foreground + #{{base00-hex}} + + + + name + Deprecated + scope + invalid.deprecated + settings + + background + #{{base0F-hex}} + foreground + #{{base07-hex}} + + + + name + Unimplemented + scope + invalid.unimplemented + settings + + background + #{{base03-hex}} + foreground + #{{base07-hex}} + + + + uuid + uuid + + diff --git a/modules/bat/hm.nix b/modules/bat/hm.nix new file mode 100644 index 0000000..58084e2 --- /dev/null +++ b/modules/bat/hm.nix @@ -0,0 +1,17 @@ +{ pkgs, config, lib, ... }: + +let + themeFile = config.lib.stylix.colors { + template = builtins.readFile ./base16-stylix.mustache; + extension = ".tmTheme"; + }; +in +{ + options.stylix.targets.bat.enable = + config.lib.stylix.mkEnableTarget "Bat" config.programs.bat.enable; + + config = lib.mkIf config.stylix.targets.bat.enable { + programs.bat.themes."base16-stylix" = builtins.readFile themeFile; + home.sessionVariables.BAT_THEME = "base16-stylix"; + }; +} From 45f856230b3507487794b20460be368ceafc2417 Mon Sep 17 00:00:00 2001 From: DwarfMaster Date: Sat, 25 Mar 2023 10:28:16 +0100 Subject: [PATCH 2/3] Add zathura support --- modules/zathura/hm.nix | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 modules/zathura/hm.nix diff --git a/modules/zathura/hm.nix b/modules/zathura/hm.nix new file mode 100644 index 0000000..46497cc --- /dev/null +++ b/modules/zathura/hm.nix @@ -0,0 +1,37 @@ +{ config, lib, ... }: + +let + colors = config.lib.stylix.colors; +in { + options.stylix.targets.zathura.enable = + config.lib.stylix.mkEnableTarget "Zathura" true; + + config = lib.mkIf config.stylix.targets.zathura.enable { + # Taken from here: + # https://github.com/doenerkebap/base16-zathura + programs.zathura.options = { + default-bg = "#${colors.base00}"; + default-fg = "#${colors.base01}"; + statusbar-fg = "#${colors.base04}"; + statusbar-bg = "#${colors.base02}"; + inputbar-bg = "#${colors.base00}"; + inputbar-fg = "#${colors.base07}"; + notification-bg = "#${colors.base00}"; + notification-fg = "#${colors.base07}"; + notification-error-bg = "#${colors.base00}"; + notification-error-fg = "#${colors.base08}"; + notification-warning-bg = "#${colors.base00}"; + notification-warning-fg = "#${colors.base08}"; + highlight-color = "#${colors.base0A}"; + highlight-active-color = "#${colors.base0D}"; + completion-bg = "#${colors.base01}"; + completion-fg = "#${colors.base0D}"; + completion-highlight-fg = "#${colors.base07}"; + completion-highlight-bg = "#${colors.base0D}"; + recolor-lightcolor = "#${colors.base00}"; + recolor-darkcolor = "#${colors.base06}"; + recolor = false; + recolor-keephue = false; + }; + }; +} From 34e5b7df618b7853963649dc45bc11cbbd60afe4 Mon Sep 17 00:00:00 2001 From: DwarfMaster Date: Sat, 25 Mar 2023 10:51:40 +0100 Subject: [PATCH 3/3] Add sxiv support --- modules/sxiv/hm.nix | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 modules/sxiv/hm.nix diff --git a/modules/sxiv/hm.nix b/modules/sxiv/hm.nix new file mode 100644 index 0000000..44c8294 --- /dev/null +++ b/modules/sxiv/hm.nix @@ -0,0 +1,19 @@ +{ config, lib, ... }: + +let + colors = config.lib.stylix.colors; + fonts = config.stylix.fonts; +in { + options.stylix.targets.sxiv.enable = + config.lib.stylix.mkEnableTarget "Sxiv" true; + + config = lib.mkIf config.stylix.targets.sxiv.enable { + xresources = { + properties = { + "Sxiv.foreground" = "#${colors.base01}"; + "Sxiv.background" = "#${colors.base04}"; + "Sxiv.font" = "${fonts.sansSerif.name}-${toString fonts.sizes.applications}"; + }; + }; + }; +}