From 8d12833e4da85edbe2156851b8a075f2cd7583f1 Mon Sep 17 00:00:00 2001 From: Micah Halter Date: Fri, 12 Jul 2024 15:12:57 -0400 Subject: [PATCH] feat(extras): add XResources theme --- lua/astrotheme/extras/init.lua | 1 + lua/astrotheme/extras/xresources.lua | 36 ++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 lua/astrotheme/extras/xresources.lua diff --git a/lua/astrotheme/extras/init.lua b/lua/astrotheme/extras/init.lua index 27468e1..4662045 100644 --- a/lua/astrotheme/extras/init.lua +++ b/lua/astrotheme/extras/init.lua @@ -29,6 +29,7 @@ M.extras = { wezterm = { ext = "toml", url = "https://wezfurlong.org/wezterm/config/files.html", label = "WezTerm" }, windows_terminal = { ext = "json", url = "https://aka.ms/terminal-documentation", label = "Windows Terminal" }, xfceterm = { ext = "theme", url = "https://docs.xfce.org/apps/terminal/advanced", label = "Xfce Terminal" }, + xresources = { ext = "Xresources", url = "https://wiki.archlinux.org/title/X_resources", label = "Xresources" }, } function M.setup() diff --git a/lua/astrotheme/extras/xresources.lua b/lua/astrotheme/extras/xresources.lua new file mode 100644 index 0000000..da3053c --- /dev/null +++ b/lua/astrotheme/extras/xresources.lua @@ -0,0 +1,36 @@ +local util = require "astrotheme.extras" + +local M = {} + +--- @param colors AstroThemePalette +function M.generate(colors) + return util.template( + [[ +! ${_style_name} colors for Xresources + +*background: ${ui.base} +*foreground: ${syntax.text} + +*color0: ${term.black} +*color1: ${term.red} +*color2: ${term.green} +*color3: ${term.yellow} +*color4: ${term.blue} +*color5: ${term.purple} +*color6: ${term.cyan} +*color7: ${term.white} + +*color8: ${term.bright_black} +*color9: ${term.bright_red} +*color10: ${term.bright_green} +*color11: ${term.bright_yellow} +*color12: ${term.bright_blue} +*color13: ${term.bright_purple} +*color14: ${term.bright_cyan} +*color15: ${term.bright_white} +]], + colors + ) +end + +return M