From c805eb89c621110bd59c0c398d3985d7deaeb6c8 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 23 Oct 2024 08:44:09 +0200 Subject: [PATCH] feat(extras): added Ghostty themes --- lua/tokyonight/extra/ghostty.lua | 37 ++++++++++++++++++++++++++++++++ lua/tokyonight/extra/init.lua | 2 ++ 2 files changed, 39 insertions(+) create mode 100644 lua/tokyonight/extra/ghostty.lua diff --git a/lua/tokyonight/extra/ghostty.lua b/lua/tokyonight/extra/ghostty.lua new file mode 100644 index 00000000..edce2920 --- /dev/null +++ b/lua/tokyonight/extra/ghostty.lua @@ -0,0 +1,37 @@ +local util = require("tokyonight.util") + +local M = {} + +--- @param colors ColorScheme +function M.generate(colors) + local theme = util.template( + [[ +palette = 0=${terminal.black} +palette = 1=${terminal.red} +palette = 2=${terminal.green} +palette = 3=${terminal.yellow} +palette = 4=${terminal.blue} +palette = 5=${terminal.magenta} +palette = 6=${terminal.cyan} +palette = 7=${terminal.white} +palette = 8=${terminal.black_bright} +palette = 9=${terminal.red_bright} +palette = 10=${terminal.green_bright} +palette = 11=${terminal.yellow_bright} +palette = 12=${terminal.blue_bright} +palette = 13=${terminal.magenta_bright} +palette = 14=${terminal.cyan_bright} +palette = 15=${terminal.white_bright} + +background = ${bg} +foreground = ${fg} +cursor-color = ${fg} +selection-background = ${bg_visual} +selection-foreground = ${fg} +]], + colors + ) + return theme +end + +return M diff --git a/lua/tokyonight/extra/init.lua b/lua/tokyonight/extra/init.lua index ab91cf18..c594da10 100644 --- a/lua/tokyonight/extra/init.lua +++ b/lua/tokyonight/extra/init.lua @@ -15,6 +15,7 @@ M.extras = { foot = { ext = "ini", url = "https://codeberg.org/dnkl/foot", label = "Foot" }, fuzzel = { ext = "ini", url = "https://codeberg.org/dnkl/fuzzel", label = "Fuzzel" }, fzf = { ext = "sh", url = "https://github.com/junegunn/fzf", label = "Fzf" }, + ghostty = { ext = "", url = "https://github.com/ghostty-org/ghostty", label = "Ghostty" }, gitui = { ext = "ron", url = "https://github.com/extrawurst/gitui", label = "GitUI" }, gnome_terminal = { ext = "dconf", url = "https://gitlab.gnome.org/GNOME/gnome-terminal", label = "GNOME Terminal" }, helix = { ext = "toml", url = "https://helix-editor.com/", label = "Helix" }, @@ -70,6 +71,7 @@ function M.setup() .. style .. "." .. info.ext + fname = string.gsub(fname, "%.$", "") -- remove trailing dot when no extension colors["_upstream_url"] = "https://github.com/folke/tokyonight.nvim/raw/main/extras/" .. fname colors["_style_name"] = "Tokyo Night" .. style_name colors["_name"] = "tokyonight_" .. style