From e7e22807a3872a0649e41868af9efe18605d5c9d Mon Sep 17 00:00:00 2001 From: Kristofers Solo Date: Wed, 24 May 2023 11:50:54 +0300 Subject: [PATCH] feat(extras): added colors for zathura (#385) Added TokyoNight colorscheme for [zathura](https://pwmt.org/projects/zathura/) document viewer. --- lua/tokyonight/extra/init.lua | 1 + lua/tokyonight/extra/zathura.lua | 53 ++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 lua/tokyonight/extra/zathura.lua diff --git a/lua/tokyonight/extra/init.lua b/lua/tokyonight/extra/init.lua index cfb4d5b..1eff89a 100644 --- a/lua/tokyonight/extra/init.lua +++ b/lua/tokyonight/extra/init.lua @@ -21,6 +21,7 @@ M.extras = { terminator = {ext = "conf", url = "https://gnome-terminator.readthedocs.io/en/latest/config.html", label = "Terminator"}, prism = {ext = "js", url = "https://prismjs.com", label = "Prism"}, windows_terminal = {ext = "json", url = "https://aka.ms/terminal-documentation", label = "Windows Terminal"}, + zathura = {ext = "zathurarc", url = "https://pwmt.org/projects/zathura/", label = "Zathura"}, } local function write(str, fileName) diff --git a/lua/tokyonight/extra/zathura.lua b/lua/tokyonight/extra/zathura.lua new file mode 100644 index 0000000..39b5af2 --- /dev/null +++ b/lua/tokyonight/extra/zathura.lua @@ -0,0 +1,53 @@ +local util = require("tokyonight.util") + +local M = {} + +--- @param colors ColorScheme +function M.generate(colors) + local zathura = util.template( + [[ +# Tokyonight color theme for Zathura +# Swaps Foreground for Background to get a light version if the user prefers +# +# Tokyonight color theme +# +set notification-error-bg "${red}" +set notification-error-fg "${fg}" +set notification-warning-bg "${yellow}" +set notification-warning-fg "${terminal_black}" +set notification-bg "${bg}" +set notification-fg "${fg}" +set completion-bg "${bg}" +set completion-fg "${fg_dark}" +set completion-group-bg "${bg}" +set completion-group-fg "${fg_dark}" +set completion-highlight-bg "${terminal_black}" +set completion-highlight-fg "${fg}" +set index-bg "${bg}" +set index-fg "${fg}" +set index-active-bg "${terminal_black}" +set index-active-fg "${fg}" +set inputbar-bg "${bg}" +set inputbar-fg "${fg}" +set statusbar-bg "${bg}" +set statusbar-fg "${fg}" +set highlight-color "${yellow}" +set highlight-active-color "${green}" +set default-bg "${bg}" +set default-fg "${fg}" +set render-loading true +set render-loading-fg "${bg}" +set render-loading-bg "${fg}" +# +# Recolor mode settings +# to switch modes +# +set recolor-lightcolor "${bg}" +set recolor-darkcolor "${fg}" +]], + colors + ) + return zathura +end + +return M