Skip to content

Commit

Permalink
windows-terminal-theme: generate using lua script
Browse files Browse the repository at this point in the history
  • Loading branch information
ful1e5 committed May 3, 2022
1 parent e954639 commit addf54f
Show file tree
Hide file tree
Showing 18 changed files with 205 additions and 167 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- terminal-theme: Xresources theme added #166
- chore: unlink 'Visual' highlight from plugin highlights
- kitty: add cursor foreground color ( fixed #174 )
- terminal-theme: Windows Terminal theme added #180 @mutecipher

### Fixes

Expand Down
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
- Minimal inactive statusline (only work with **Vim's Default StatusLine**)
- Vim terminal colors
- Darker background for sidebar-like windows
- Color configs for [kitty](https://sw.kovidgoyal.net/kitty/conf.html?highlight=include), [iTerm2](https://iterm2.com/), [Konsole](https://konsole.kde.org/), [tmux](https://github.com/tmux/tmux/wiki), [Xresources](https://wiki.archlinux.org/title/x_resources) and [Alacritty](https://github.com/alacritty/alacritty)
- Color configs for [kitty](https://sw.kovidgoyal.net/kitty/conf.html?highlight=include), [iTerm2](https://iterm2.com/), [Konsole](https://konsole.kde.org/), [tmux](https://github.com/tmux/tmux/wiki), [Xresources](https://wiki.archlinux.org/title/x_resources), [Windows Terminal](https://github.com/microsoft/terminal) and [Alacritty](https://github.com/alacritty/alacritty)
- Most elegant [**lualine** theme](./LUALINE.md#screenshots)

## Requirements
Expand Down Expand Up @@ -124,12 +124,13 @@ Installation docs and screenshots at [LUALINE.md](./LUALINE.md).
Extra color configs for **kitty**, **iTerm**, **Konsole**, **tmux**, **Xresources** and **Alacritty** can be found in [terminal](terminal/) directory. To use them, refer to their respective documentation.

- kitty - [./terminal/kitty](https://github.com/projekt0n/github-nvim-theme/tree/main/terminal/kitty)
- iTerm - [./terminal/iterm](https://github.com/projekt0n/github-nvim-theme/tree/main/terminal/iterm)
- Konsole - [./terminal/konsole](https://github.com/projekt0n/github-nvim-theme/tree/main/terminal/konsole)
- tmux - [./terminal/tmux](https://github.com/projekt0n/github-nvim-theme/tree/main/terminal/tmux)
- Alacritty - [./terminal/alacritty](https://github.com/projekt0n/github-nvim-theme/tree/main/terminal/alacritty)
- Konsole - [./terminal/konsole](https://github.com/projekt0n/github-nvim-theme/tree/main/terminal/konsole)
- Windows Terminal - [./terminal/windows_terminal](https://github.com/projekt0n/github-nvim-theme/tree/main/terminal/windows_terminal)
- Xresources - [./terminal/xresources](https://github.com/projekt0n/github-nvim-theme/tree/main/terminal/xresources)
- iTerm - [./terminal/iterm](https://github.com/projekt0n/github-nvim-theme/tree/main/terminal/iterm)
- kitty - [./terminal/kitty](https://github.com/projekt0n/github-nvim-theme/tree/main/terminal/kitty)
- tmux - [./terminal/tmux](https://github.com/projekt0n/github-nvim-theme/tree/main/terminal/tmux)

### Making `undercurls` work properly in **Tmux**

Expand Down
35 changes: 35 additions & 0 deletions lua/github-theme/terminal/windows_terminal.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
local palette = require('github-theme.palette')
local util = require('github-theme.util')

---Generate github theme for windows terminal.
---@param cfg gt.ConfigSchema
return function(cfg)
local colors = palette.get_palette(cfg.theme_style)

local name = 'Github ' .. cfg.theme_style:lower():gsub('^%l', string.upper)
local windows_terminal = util.template([[
{
"name": "]] .. name .. [[",
"background": "${bg}",
"foreground": "${fg_term}",
"cursorColor": "${cursor}",
"selectionBackground": "${bg_visual_selection}",
"black": "${black}",
"brightBlack": "${bright_black}",
"white": "${white}",
"brightWhite": "${bright_white}",
"red": "${red}",
"brightRed": "${bright_red}",
"green": "${green}",
"brightGreen": "${bright_green}",
"yellow": "${yellow}",
"brightYellow": "${bright_yellow}",
"blue": "${blue}",
"brightBlue": "${bright_blue}",
"purple": "${magenta}",
"brightPurple": "${bright_magenta}",
"cyan": "${cyan}",
"brightCyan": "${bright_cyan}"
}]], colors)
return windows_terminal
end
3 changes: 2 additions & 1 deletion lua/github-theme/types/gt.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,15 @@ gt.HighlightStyle.Stanout = 'stanout'
gt.HighlightStyle.NoCombine = 'nocombine'
gt.HighlightStyle.Strikethrough = 'strikethrough'

---@alias gt.TerminalConf "'conf'" | "'yml'" | "'itermcolors'" | "'colorscheme'" | "'tmux'" | "'xresources'"
---@alias gt.TerminalConf "'conf'" | "'yml'" | "'itermcolors'" | "'colorscheme'" | "'tmux'" | "'xresources'" | "windows_terminal"
gt.TerminalConf = {}
gt.TerminalConf.kitty = 'conf'
gt.TerminalConf.alacritty = 'yml'
gt.TerminalConf.iterm = 'itermcolors'
gt.TerminalConf.konsole = 'colorscheme'
gt.TerminalConf.tmux = 'conf'
gt.TerminalConf.xresources = 'Xresources'
gt.TerminalConf.windows_terminal = 'json'

---@class gt.Highlight
---Foreground Color
Expand Down
23 changes: 0 additions & 23 deletions terminal/windows-terminal/github_dark.json

This file was deleted.

23 changes: 0 additions & 23 deletions terminal/windows-terminal/github_dark_colorblind.json

This file was deleted.

23 changes: 0 additions & 23 deletions terminal/windows-terminal/github_dark_default.json

This file was deleted.

23 changes: 0 additions & 23 deletions terminal/windows-terminal/github_dimmed.json

This file was deleted.

23 changes: 0 additions & 23 deletions terminal/windows-terminal/github_light.json

This file was deleted.

23 changes: 0 additions & 23 deletions terminal/windows-terminal/github_light_colorblind.json

This file was deleted.

23 changes: 0 additions & 23 deletions terminal/windows-terminal/github_light_default.json

This file was deleted.

23 changes: 23 additions & 0 deletions terminal/windows_terminal/github_dark.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "Github Dark",
"background": "#24292e",
"foreground": "#d1d5da",
"cursorColor": "#c8e1ff",
"selectionBackground": "#284566",
"black": "#586069",
"brightBlack": "#959da5",
"white": "#d1d5da",
"brightWhite": "#fafbfc",
"red": "#ea4a5a",
"brightRed": "#f97583",
"green": "#34d058",
"brightGreen": "#85e89d",
"yellow": "#ffea7f",
"brightYellow": "#ffea7f",
"blue": "#2188ff",
"brightBlue": "#79b8ff",
"purple": "#b392f0",
"brightPurple": "#b392f0",
"cyan": "#39c5cf",
"brightCyan": "#56d4dd"
}
23 changes: 23 additions & 0 deletions terminal/windows_terminal/github_dark_colorblind.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "Github Dark_colorblind",
"background": "#0d1117",
"foreground": "#b3b1ad",
"cursorColor": "#73b7f2",
"selectionBackground": "#163356",
"black": "#484f58",
"brightBlack": "#6e7681",
"white": "#b1bac4",
"brightWhite": "#f0f6fc",
"red": "#ff7b72",
"brightRed": "#ffa198",
"green": "#3fb950",
"brightGreen": "#56d364",
"yellow": "#d29922",
"brightYellow": "#e3b341",
"blue": "#58a6ff",
"brightBlue": "#79c0ff",
"purple": "#bc8cff",
"brightPurple": "#d2a8ff",
"cyan": "#39c5cf",
"brightCyan": "#56d4dd"
}
23 changes: 23 additions & 0 deletions terminal/windows_terminal/github_dark_default.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "Github Dark_default",
"background": "#0d1117",
"foreground": "#b3b1ad",
"cursorColor": "#73b7f2",
"selectionBackground": "#163356",
"black": "#484f58",
"brightBlack": "#6e7681",
"white": "#b1bac4",
"brightWhite": "#f0f6fc",
"red": "#ff7b72",
"brightRed": "#ffa198",
"green": "#3fb950",
"brightGreen": "#56d364",
"yellow": "#d29922",
"brightYellow": "#e3b341",
"blue": "#58a6ff",
"brightBlue": "#79c0ff",
"purple": "#bc8cff",
"brightPurple": "#d2a8ff",
"cyan": "#39c5cf",
"brightCyan": "#56d4dd"
}
23 changes: 23 additions & 0 deletions terminal/windows_terminal/github_dimmed.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "Github Dimmed",
"background": "#22272e",
"foreground": "#768390",
"cursorColor": "#6cb6ff",
"selectionBackground": "#264466",
"black": "#545d68",
"brightBlack": "#636e7b",
"white": "#909dab",
"brightWhite": "#cdd9e5",
"red": "#f47067",
"brightRed": "#ff938a",
"green": "#57ab5a",
"brightGreen": "#6bc46d",
"yellow": "#c69026",
"brightYellow": "#daaa3f",
"blue": "#539bf5",
"brightBlue": "#6cb6ff",
"purple": "#b083f0",
"brightPurple": "#dcbdfb",
"cyan": "#39c5cf",
"brightCyan": "#56d4dd"
}
23 changes: 23 additions & 0 deletions terminal/windows_terminal/github_light.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "Github Light",
"background": "#ffffff",
"foreground": "#24292f",
"cursorColor": "#044289",
"selectionBackground": "#dbe9f9",
"black": "#24292e",
"brightBlack": "#959da5",
"white": "#6a737d",
"brightWhite": "#d1d5da",
"red": "#d73a49",
"brightRed": "#cb2431",
"green": "#28a745",
"brightGreen": "#22863a",
"yellow": "#dbab09",
"brightYellow": "#b08800",
"blue": "#0366d6",
"brightBlue": "#005cc5",
"purple": "#5a32a3",
"brightPurple": "#5a32a3",
"cyan": "#0598bc",
"brightCyan": "#3192aa"
}
Loading

0 comments on commit addf54f

Please sign in to comment.