From baa123945097f5cec41e372a50de4dece051f462 Mon Sep 17 00:00:00 2001 From: Bauke Date: Wed, 15 Apr 2020 23:18:16 +0200 Subject: [PATCH] Create the Kitty theme. --- .gitignore | 12 +++--- ReadMe.md | 1 + package.json | 5 ++- source/kitty/love-template.conf | 68 +++++++++++++++++++++++++++++++++ source/pages/index.html | 3 ++ source/scripts/kitty.ts | 43 +++++++++++++++++++++ 6 files changed, 124 insertions(+), 8 deletions(-) create mode 100644 source/kitty/love-template.conf create mode 100644 source/scripts/kitty.ts diff --git a/.gitignore b/.gitignore index a3dcb71..9cc1c96 100644 --- a/.gitignore +++ b/.gitignore @@ -112,11 +112,11 @@ public/ # Generated theme outputs. source/atom/love-* +source/kitty/* +!source/kitty/love-template.conf +source/sublime-text/* +!source/sublime-text/love-template.sublime-color-scheme +source/tauon/* +!source/tauon/love-template.ttheme source/vscode/themes/love-dark.color-theme.json source/vscode/themes/love-light.color-theme.json -source/sublime-text/love-dark.sublime-color-scheme -source/sublime-text/love-light.sublime-color-scheme -source/sublime-text/Love.sublime-package -source/tauon/Love Dark.ttheme -source/tauon/Love Light.ttheme -source/tauon/love-tauon.zip diff --git a/ReadMe.md b/ReadMe.md index e4d779f..aff0f2d 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -12,6 +12,7 @@ * [Atom](https://atom.io/users/HollloCC) * Firefox Color [Dark](https://color.firefox.com/?theme=XQAAAAIYAQAAAAAAAABBqYhm849SCia2CaaEGccwS-xNKlhSXT3Vtt2XDAs6h7gdL5pcAb7xqXopx66Ln4wY2B4_apm1Xo1m-kSLNybjC15LIb4OXWhGfyPJrZA2e0IeJeWC0yox2SBMD04SrZBvZwoC8QX9EBbJd69TMCmh7d-g0Wc_msdR2nzvnbFECN4_c5VKI9Btzbzvdvjw1-KH_nfezJDCoRea7HASdSJBgMVdHiWfmWiLujatKOWmCJfGaFyV_75SjmA)/[Light](https://color.firefox.com/?theme=XQAAAAIqAQAAAAAAAABBqYhm849SCia2CaaEGccwS-xNKliFvSp4LiFpmRcA5AwYsIABKiGtHcakOiV8NSmxjnVR9H4TYg2VNxSp6iDrgcvBoo3NoFSZSndEX6ZHCH8h1ahP78I4dZXjJD8ZzlOxqC6HrDKQmTBAEm09iix8uVI5_QcbhtDjDxpYbPP5WGvXu84Za9H0s1VXwrgKdxIgKTJraGh0P5bPsWJ_YY-lPSsAB62ABnbOV7SJEIMsWMC9a01QhpCubrrA-f_WNVAA) +* [Kitty](https://love.holllo.cc/love-kitty.zip) * [Sublime Text](https://love.holllo.cc/Love.sublime-package) * [Tauon](https://love.holllo.cc/love-tauon.zip) * [Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=Holllo.love) diff --git a/package.json b/package.json index d5eab7b..42dd65e 100644 --- a/package.json +++ b/package.json @@ -6,16 +6,17 @@ "homepage": "https://love.holllo.cc", "repository": "https://gitlab.com/holllo/love", "scripts": { - "build": "yarn build:atom && yarn build:images && yarn build:pages && yarn build:sublime-text && yarn build:tauon && yarn build:vscode && yarn copy-themes", + "build": "yarn build:atom && yarn build:images && yarn build:kitty && yarn build:pages && yarn build:sublime-text && yarn build:tauon && yarn build:vscode && yarn copy-themes", "build:atom": "ts-node 'source/scripts/atom.ts'", "build:images": "cpy 'source/pages/images/**' 'public/images/'", "build:pages": "ts-node 'source/scripts/pages.ts'", + "build:kitty": "ts-node 'source/scripts/kitty.ts'", "build:sublime-text": "ts-node 'source/scripts/sublime-text.ts'", "build:tauon": "ts-node 'source/scripts/tauon.ts'", "build:vscode": "ts-node 'source/scripts/vscode.ts'", "watch:atom": "chokidar 'source/atom/*.less' 'source/atom/ui-template/*.less' -c 'yarn build:atom'", "watch:vscode": "chokidar 'source/vscode/themes/love-template.color-theme.json' -c 'yarn build:vscode'", - "copy-themes": "cp 'source/sublime-text/Love.sublime-package' 'public/' && cp 'source/tauon/love-tauon.zip' 'public/'", + "copy-themes": "cp 'source/kitty/love-kitty.zip' 'public/' && cp 'source/sublime-text/Love.sublime-package' 'public/' && cp 'source/tauon/love-tauon.zip' 'public/'", "test": "xo && stylelint 'source/pages/scss/**'" }, "dependencies": { diff --git a/source/kitty/love-template.conf b/source/kitty/love-template.conf new file mode 100644 index 0000000..0c1923e --- /dev/null +++ b/source/kitty/love-template.conf @@ -0,0 +1,68 @@ +# The Love Theme for Kitty +# Version: 0.1.0 +# https://love.holllo.cc + +# Documentation: +# https://sw.kovidgoyal.net/kitty/conf.html#color-scheme + +# Main Colors + +foreground {{ love.colors.foreground1 }} +background {{ love.colors.background1 }} +selection_foreground {{ love.colors.background1 }} +selection_background {{ love.colors.foreground1 }} + +# Accent Colors + +color0 {{ love.colors.background2 }} +color8 {{ love.colors.background2 }} + +color1 {{ love.colors.accents[0] }} +color9 {{ love.colors.accents[0] }} + +color2 {{ love.colors.accents[3] }} +color10 {{ love.colors.accents[3] }} + +color3 {{ love.colors.accents[1] }} +color11 {{ love.colors.accents[1] }} + +color4 {{ love.colors.accents[8] }} +color12 {{ love.colors.accents[8] }} + +color5 {{ love.colors.accents[9] }} +color13 {{ love.colors.accents[9] }} + +color6 {{ love.colors.accents[6] }} +color14 {{ love.colors.accents[6] }} + +color7 {{ love.colors.foreground1 }} +color15 {{ love.colors.foreground1 }} + +# Cursor + +cursor {{ love.colors.foreground1 }} + +# Tabs + +tab_fade 1 + +active_tab_foreground {{ love.colors.background1 }} +active_tab_background {{ love.colors.foreground1 }} +active_tab_font_style bold + +inactive_tab_foreground {{ love.colors.foreground1 }} +inactive_tab_background {{ love.colors.background2 }} +inactive_tab_font_style normal + +# URLs + +url_color {{ love.colors.accents[6] }} +url_style curly + +# Windows + +active_border_color {{ love.colors.accents[6] }} + +bell_border_color {{ love.colors.accents[0] }} + +inactive_border_color {{ love.colors.background2 }} diff --git a/source/pages/index.html b/source/pages/index.html index ebadb2b..51ecc70 100644 --- a/source/pages/index.html +++ b/source/pages/index.html @@ -166,6 +166,9 @@ {{- '/' -}} Light +
  • + Kitty +
  • Sublime Text
  • diff --git a/source/scripts/kitty.ts b/source/scripts/kitty.ts new file mode 100644 index 0000000..532e8a8 --- /dev/null +++ b/source/scripts/kitty.ts @@ -0,0 +1,43 @@ +import {promises as fsp} from 'fs'; +import {join} from 'path'; +import Zip from 'jszip'; +import nunjucks from 'nunjucks'; +import {generateLove, LoveVariant} from './love'; + +export async function entry(): Promise { + const themeDirectory: string = join(__dirname, '../kitty/'); + // Configure Nunjucks to use the templates for `source/kitty/`. + nunjucks.configure(themeDirectory, { + lstripBlocks: true, + trimBlocks: true, + throwOnUndefined: true + }); + + // Create a new zip archive. + const kittyPackage: Zip = new Zip(); + + // Generate the Love variants. + const love: LoveVariant[] = generateLove(); + + for (const variant of love) { + const themeName = `love-${variant.name}.conf`; + const outputPath: string = join(themeDirectory, themeName); + + // Render the template. + const theme: string = nunjucks.render('love-template.conf', { + love: variant + }); + + // Write the theme to file and add it to the zip archive. + await fsp.writeFile(outputPath, theme); + kittyPackage.file(themeName, theme); + } + + // Write the zip archive to file. + const zip: Buffer = await kittyPackage.generateAsync({type: 'nodebuffer'}); + await fsp.writeFile(join(themeDirectory, 'love-kitty.zip'), zip); +} + +if (require.main === module) { + entry(); +}