Skip to content

Commit

Permalink
feat(extras): add st colorscheme
Browse files Browse the repository at this point in the history
  • Loading branch information
mehalter committed Jul 15, 2024
1 parent 851757e commit 28f2a1d
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
1 change: 1 addition & 0 deletions lua/astrotheme/extras/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ M.extras = {
lua = { ext = "lua", url = "https://www.lua.org", label = "Lua Table for testing" },
slack = {ext = "txt", url = "https://slack.com", label = "Slack"},
spotify_player = {ext = "toml", url = "https://github.com/aome510/spotify-player", label = "Spotify Player"},
st = {ext = "h", url = "https://st.suckless.org/", label = "simple terminal"},
terminator = { ext = "conf", url = "https://gnome-terminator.readthedocs.io/en/latest/config.html", label = "Terminator" },
tilix = { ext = "json", url = "https://github.com/gnunn1/tilix", label = "Tilix" },
vim = { ext = "vim", url = "https://vimhelp.org/", label = "Vim", subdir = "colors"},
Expand Down
50 changes: 50 additions & 0 deletions lua/astrotheme/extras/st.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
local util = require "astrotheme.extras"

local M = {}

--- @param colors AstroThemePalette
function M.generate(colors)
return util.template(
[[
/* Terminal colors (16 first used in escape sequence) */
static const char *colorname[] = {
/* 8 normal colors */
"${term.black}",
"${term.red}",
"${term.green}",
"${term.yellow}",
"${term.blue}",
"${term.purple}",
"${term.cyan}",
"${term.white}",
/* 8 bright colors */
"${term.bright_black}",
"${term.bright_red}",
"${term.bright_green}",
"${term.bright_yellow}",
"${term.bright_blue}",
"${term.bright_purple}",
"${term.bright_cyan}",
"${term.bright_white}",
[256] = "${syntax.text}",
[257] = "${ui.selection}",
[258] = "${syntax.text}", /* default foreground colour */
[259] = "${ui.base}", /* default background colour */
};
/*
* Default colors (colorname index)
* foreground, background, cursor, reverse cursor
*/
unsigned int defaultfg = 258;
unsigned int defaultbg = 259;
unsigned int defaultcs = 256;
static unsigned int defaultrcs = 257;
]],
colors
)
end

return M

0 comments on commit 28f2a1d

Please sign in to comment.