Skip to content

Commit

Permalink
terminal-theme: Xresources theme added #166
Browse files Browse the repository at this point in the history
  • Loading branch information
ful1e5 committed Mar 15, 2022
1 parent 508d430 commit e56b49e
Show file tree
Hide file tree
Showing 12 changed files with 229 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- enhance: `overrides` function is now able to add custom highlight in `dev` mode.
- docs: about developer mode
- breaking-change: set lualine theme with `theme="auto"`
- terminal-theme: Xresources theme added #166

### Fixes

Expand Down
2 changes: 1 addition & 1 deletion LUALINE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
To enable the `github` theme for `Lualine`, simply specify it in your lualine settings **after theme settings**:A
To enable the `github` theme for `Lualine`, simply specify it in your lualine settings **after theme settings**.

### packer

Expand Down
3 changes: 2 additions & 1 deletion 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) 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) and [Alacritty](https://github.com/alacritty/alacritty)
- Most elegant [**lualine** theme](./LUALINE.md#screenshots)

## Requirements
Expand Down Expand Up @@ -129,6 +129,7 @@ Extra color configs for **kitty**, **iTerm**, **Konsole**, **tmux** and **Alacri
- 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)
- Xresources - [./terminal/xresources](https://github.com/projekt0n/github-nvim-theme/tree/main/terminal/xresources)

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

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

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

local xresources = util.template(
[[
*.foreground: ${fg_term}
#ifdef background_opacity
*.background: [background_opacity]${bg}
#else
*.background: ${bg}
#endif
*.cursorColor: ${cursor}
*.color0: ${black}
*.color1: ${red}
*.color2: ${green}
*.color3: ${yellow}
*.color4: ${blue}
*.color5: ${magenta}
*.color6: ${cyan}
*.color7: ${white}
*.color8: ${bright_black}
*.color9: ${bright_red}
*.color10: ${bright_green}
*.color11: ${bright_yellow}
*.color12: ${bright_blue}
*.color13: ${bright_magenta}
*.color14: ${bright_cyan}
*.color15: ${bright_white}
]],
colors
)
return xresources
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,13 +23,14 @@ gt.HighlightStyle.Stanout = 'stanout'
gt.HighlightStyle.NoCombine = 'nocombine'
gt.HighlightStyle.Strikethrough = 'strikethrough'

---@alias gt.TerminalConf "'conf'" | "'yml'" | "'itermcolors'" | "'colorscheme'" | "'tmux'"
---@alias gt.TerminalConf "'conf'" | "'yml'" | "'itermcolors'" | "'colorscheme'" | "'tmux'" | "'xresources'"
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'

---@class gt.Highlight
---Foreground Color
Expand Down
26 changes: 26 additions & 0 deletions terminal/xresources/github_dark.Xresources
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

*.foreground: #d1d5da
#ifdef background_opacity
*.background: [background_opacity]#24292e
#else
*.background: #24292e
#endif
*.cursorColor: #c8e1ff

*.color0: #586069
*.color1: #ea4a5a
*.color2: #34d058
*.color3: #ffea7f
*.color4: #2188ff
*.color5: #b392f0
*.color6: #39c5cf
*.color7: #d1d5da

*.color8: #959da5
*.color9: #f97583
*.color10: #85e89d
*.color11: #ffea7f
*.color12: #79b8ff
*.color13: #b392f0
*.color14: #56d4dd
*.color15: #fafbfc
26 changes: 26 additions & 0 deletions terminal/xresources/github_dark_colorblind.Xresources
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

*.foreground: #b3b1ad
#ifdef background_opacity
*.background: [background_opacity]#0d1117
#else
*.background: #0d1117
#endif
*.cursorColor: #73b7f2

*.color0: #484f58
*.color1: #ff7b72
*.color2: #3fb950
*.color3: #d29922
*.color4: #58a6ff
*.color5: #bc8cff
*.color6: #39c5cf
*.color7: #b1bac4

*.color8: #6e7681
*.color9: #ffa198
*.color10: #56d364
*.color11: #e3b341
*.color12: #79c0ff
*.color13: #d2a8ff
*.color14: #56d4dd
*.color15: #f0f6fc
26 changes: 26 additions & 0 deletions terminal/xresources/github_dark_default.Xresources
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

*.foreground: #b3b1ad
#ifdef background_opacity
*.background: [background_opacity]#0d1117
#else
*.background: #0d1117
#endif
*.cursorColor: #73b7f2

*.color0: #484f58
*.color1: #ff7b72
*.color2: #3fb950
*.color3: #d29922
*.color4: #58a6ff
*.color5: #bc8cff
*.color6: #39c5cf
*.color7: #b1bac4

*.color8: #6e7681
*.color9: #ffa198
*.color10: #56d364
*.color11: #e3b341
*.color12: #79c0ff
*.color13: #d2a8ff
*.color14: #56d4dd
*.color15: #f0f6fc
26 changes: 26 additions & 0 deletions terminal/xresources/github_dimmed.Xresources
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

*.foreground: #768390
#ifdef background_opacity
*.background: [background_opacity]#22272e
#else
*.background: #22272e
#endif
*.cursorColor: #6cb6ff

*.color0: #545d68
*.color1: #f47067
*.color2: #57ab5a
*.color3: #c69026
*.color4: #539bf5
*.color5: #b083f0
*.color6: #39c5cf
*.color7: #909dab

*.color8: #636e7b
*.color9: #ff938a
*.color10: #6bc46d
*.color11: #daaa3f
*.color12: #6cb6ff
*.color13: #dcbdfb
*.color14: #56d4dd
*.color15: #cdd9e5
26 changes: 26 additions & 0 deletions terminal/xresources/github_light.Xresources
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

*.foreground: #24292f
#ifdef background_opacity
*.background: [background_opacity]#ffffff
#else
*.background: #ffffff
#endif
*.cursorColor: #044289

*.color0: #24292e
*.color1: #d73a49
*.color2: #28a745
*.color3: #dbab09
*.color4: #0366d6
*.color5: #5a32a3
*.color6: #0598bc
*.color7: #6a737d

*.color8: #959da5
*.color9: #cb2431
*.color10: #22863a
*.color11: #b08800
*.color12: #005cc5
*.color13: #5a32a3
*.color14: #3192aa
*.color15: #d1d5da
26 changes: 26 additions & 0 deletions terminal/xresources/github_light_colorblind.Xresources
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

*.foreground: #0E1116
#ifdef background_opacity
*.background: [background_opacity]#ffffff
#else
*.background: #ffffff
#endif
*.cursorColor: #0969da

*.color0: #24292f
*.color1: #cf222e
*.color2: #116329
*.color3: #4d2d00
*.color4: #0969da
*.color5: #8250df
*.color6: #1b7c83
*.color7: #6e7781

*.color8: #57606a
*.color9: #a40e26
*.color10: #1a7f37
*.color11: #633c01
*.color12: #218bff
*.color13: #a475f9
*.color14: #3192aa
*.color15: #8c959f
26 changes: 26 additions & 0 deletions terminal/xresources/github_light_default.Xresources
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

*.foreground: #0E1116
#ifdef background_opacity
*.background: [background_opacity]#ffffff
#else
*.background: #ffffff
#endif
*.cursorColor: #044289

*.color0: #24292f
*.color1: #cf222e
*.color2: #116329
*.color3: #4d2d00
*.color4: #0969da
*.color5: #8250df
*.color6: #1b7c83
*.color7: #6e7781

*.color8: #57606a
*.color9: #a40e26
*.color10: #1a7f37
*.color11: #633c01
*.color12: #218bff
*.color13: #a475f9
*.color14: #3192aa
*.color15: #8c959f

0 comments on commit e56b49e

Please sign in to comment.