Skip to content

Commit 28f2a1d

Browse files
committed
feat(extras): add st colorscheme
1 parent 851757e commit 28f2a1d

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

lua/astrotheme/extras/init.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ M.extras = {
2525
lua = { ext = "lua", url = "https://www.lua.org", label = "Lua Table for testing" },
2626
slack = {ext = "txt", url = "https://slack.com", label = "Slack"},
2727
spotify_player = {ext = "toml", url = "https://github.com/aome510/spotify-player", label = "Spotify Player"},
28+
st = {ext = "h", url = "https://st.suckless.org/", label = "simple terminal"},
2829
terminator = { ext = "conf", url = "https://gnome-terminator.readthedocs.io/en/latest/config.html", label = "Terminator" },
2930
tilix = { ext = "json", url = "https://github.com/gnunn1/tilix", label = "Tilix" },
3031
vim = { ext = "vim", url = "https://vimhelp.org/", label = "Vim", subdir = "colors"},

lua/astrotheme/extras/st.lua

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
local util = require "astrotheme.extras"
2+
3+
local M = {}
4+
5+
--- @param colors AstroThemePalette
6+
function M.generate(colors)
7+
return util.template(
8+
[[
9+
/* Terminal colors (16 first used in escape sequence) */
10+
static const char *colorname[] = {
11+
/* 8 normal colors */
12+
"${term.black}",
13+
"${term.red}",
14+
"${term.green}",
15+
"${term.yellow}",
16+
"${term.blue}",
17+
"${term.purple}",
18+
"${term.cyan}",
19+
"${term.white}",
20+
21+
/* 8 bright colors */
22+
"${term.bright_black}",
23+
"${term.bright_red}",
24+
"${term.bright_green}",
25+
"${term.bright_yellow}",
26+
"${term.bright_blue}",
27+
"${term.bright_purple}",
28+
"${term.bright_cyan}",
29+
"${term.bright_white}",
30+
31+
[256] = "${syntax.text}",
32+
[257] = "${ui.selection}",
33+
[258] = "${syntax.text}", /* default foreground colour */
34+
[259] = "${ui.base}", /* default background colour */
35+
};
36+
37+
/*
38+
* Default colors (colorname index)
39+
* foreground, background, cursor, reverse cursor
40+
*/
41+
unsigned int defaultfg = 258;
42+
unsigned int defaultbg = 259;
43+
unsigned int defaultcs = 256;
44+
static unsigned int defaultrcs = 257;
45+
]],
46+
colors
47+
)
48+
end
49+
50+
return M

0 commit comments

Comments
 (0)