handlebars for kitty
This commit is contained in:
parent
211b5ae702
commit
1363787086
7 changed files with 153 additions and 178 deletions
2
index.ts
2
index.ts
|
@ -46,7 +46,7 @@ program
|
|||
log(options.verbose, await buildYAML(), timer)
|
||||
|
||||
if (options.verbose) console.info('Building Ports...')
|
||||
// log(options.verbose, await buildKitty(), timer)
|
||||
log(options.verbose, await buildKitty(), timer)
|
||||
// log(options.verbose, await buildNeovim(), timer)
|
||||
});
|
||||
|
||||
|
|
38
ports/kitty/dist/kitty.conf
vendored
38
ports/kitty/dist/kitty.conf
vendored
|
@ -25,6 +25,25 @@ cursor_trail_color #E1B392
|
|||
url_color #8CC8E0
|
||||
####################
|
||||
|
||||
#########################
|
||||
# window border colors and terminal bell colors
|
||||
active_border_color #23DBC1
|
||||
inactive_border_color #4E6872
|
||||
bell_border_color #FF9F6F
|
||||
# visual_bell_color none
|
||||
####################
|
||||
|
||||
|
||||
#########################
|
||||
# Tab bar colors
|
||||
active_tab_foreground #C6E4F0
|
||||
active_tab_background #19323B
|
||||
inactive_tab_foreground #C6E4F0
|
||||
inactive_tab_background #4E6872
|
||||
# tab_bar_background #00040B
|
||||
# tab_bar_margin_color none
|
||||
####################
|
||||
|
||||
#########################
|
||||
# Marks colors
|
||||
# mark1_foreground black
|
||||
|
@ -35,23 +54,6 @@ url_color #8CC8E0
|
|||
# mark3_background #f274bc
|
||||
####################
|
||||
|
||||
#########################
|
||||
# Tab bar colors
|
||||
active_tab_foreground #C6E4F0
|
||||
active_tab_background #19323B
|
||||
inactive_tab_foreground #C6E4F0
|
||||
inactive_tab_background #4E6872
|
||||
# tab_bar_background #{pit.toHex()}
|
||||
# tab_bar_margin_color none
|
||||
####################
|
||||
|
||||
#########################
|
||||
# window border colors and terminal bell colors
|
||||
active_border_color #23DBC1
|
||||
inactive_border_color #4E6872
|
||||
bell_border_color #FF9F6F
|
||||
# visual_bell_color none
|
||||
####################
|
||||
|
||||
#########################
|
||||
# The basic 16 colors
|
||||
|
@ -86,4 +88,4 @@ color14 #23DBC1
|
|||
#: white
|
||||
color7 #C6E4F0
|
||||
color15 #C6E4F0
|
||||
####################
|
||||
####################
|
||||
|
|
6
ports/kitty/dist/palette.toml
vendored
6
ports/kitty/dist/palette.toml
vendored
|
@ -1,6 +0,0 @@
|
|||
#########################
|
||||
# verdigris for kitty
|
||||
# 0.0.1
|
||||
# GPL-3.0-only
|
||||
# https://git.basking.monster/gaiety/verdigris
|
||||
####################
|
|
@ -1,31 +1,17 @@
|
|||
import appRoot from 'app-root-path'
|
||||
import { rmFile, mkFilePath, appendToFile } from "../../../src/helpers/file"
|
||||
import { headerInfo, colorsBasic, colorsURLs, colorsCursor, colorsMarks, colorsTabBar, colorsBordersAndAlerts, colorsBasic16 } from './data'
|
||||
import { renderToFile } from "../../../src/helpers/file"
|
||||
import getData from './data'
|
||||
|
||||
const file = appRoot + '/ports/kitty/dist/kitty.conf'
|
||||
|
||||
const appendToKittyConf = async (content: string) => await appendToFile(file, content)
|
||||
const templateFile = appRoot + '/ports/kitty/src/templates/kitty.conf.hbs'
|
||||
const outputFile = appRoot + '/ports/kitty/dist/kitty.conf'
|
||||
|
||||
export default async function(isVerbose = false): Promise<string> {
|
||||
if (isVerbose) console.info('Kitty: Removing previous build', file)
|
||||
try {
|
||||
await rmFile(file)
|
||||
} catch (error) {
|
||||
console.info('Kitty: Previous build already removed')
|
||||
}
|
||||
if (isVerbose) console.info('Kitty: Ensuring path and file exist', file)
|
||||
await mkFilePath(file)
|
||||
if (isVerbose) console.info('Kitty: Writing header info to file', file)
|
||||
await appendToKittyConf(headerInfo())
|
||||
if (isVerbose) console.info('Kitty: Writing color palette into file', file)
|
||||
await appendToKittyConf(colorsBasic())
|
||||
await appendToKittyConf(colorsCursor())
|
||||
await appendToKittyConf(colorsURLs())
|
||||
await appendToKittyConf(colorsMarks())
|
||||
await appendToKittyConf(colorsTabBar())
|
||||
await appendToKittyConf(colorsBordersAndAlerts())
|
||||
await appendToKittyConf(colorsBasic16())
|
||||
await renderToFile(templateFile, outputFile, getData(), isVerbose)
|
||||
|
||||
return file
|
||||
return outputFile
|
||||
} catch (error) {
|
||||
throw error
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,136 +1,24 @@
|
|||
import { name, version } from '../info.toml'
|
||||
import { license, url } from '../../../package.json'
|
||||
import {
|
||||
pit,
|
||||
depths,
|
||||
stope,
|
||||
text,
|
||||
orange,
|
||||
teal,
|
||||
red,
|
||||
yellow,
|
||||
green,
|
||||
blue,
|
||||
purple,
|
||||
} from '../../../src/palette'
|
||||
import colors from '../../../src/palette'
|
||||
import type { Colors } from '../../../src/palette'
|
||||
import Color from '../../../src/helpers/color'
|
||||
|
||||
export function headerInfo(): string {
|
||||
return `#########################
|
||||
# ${name} for kitty
|
||||
# ${version}
|
||||
# ${license}
|
||||
# ${url}
|
||||
####################
|
||||
|
||||
`
|
||||
export default function(): any {
|
||||
return {
|
||||
name,
|
||||
version,
|
||||
license,
|
||||
url,
|
||||
...flattenColorsToHex(),
|
||||
}
|
||||
}
|
||||
|
||||
export function colorsBasic(): string {
|
||||
return `#########################
|
||||
# The basic colors
|
||||
foreground ${text.toHex()}
|
||||
background ${pit.toHex()}
|
||||
selection_foreground ${depths.toHex()}
|
||||
selection_background ${text.toHex()}
|
||||
####################
|
||||
|
||||
`
|
||||
function flattenColorsToHex(): Colors {
|
||||
return colors.reduce((acc, color) => {
|
||||
return {
|
||||
[color.nameSnakeCase]: color.toHex(),
|
||||
...acc,
|
||||
}
|
||||
}, {})
|
||||
}
|
||||
|
||||
export function colorsCursor(): string {
|
||||
return `#########################
|
||||
# Cursor colors
|
||||
cursor ${text.toHex()}
|
||||
cursor_text_color ${depths.toHex()}
|
||||
cursor_trail_color ${yellow.toHex()}
|
||||
####################
|
||||
|
||||
`
|
||||
}
|
||||
|
||||
export function colorsURLs(): string {
|
||||
return `#########################
|
||||
# URL colors
|
||||
url_color ${blue.toHex()}
|
||||
####################
|
||||
|
||||
`
|
||||
}
|
||||
|
||||
export function colorsBordersAndAlerts(): string {
|
||||
return `#########################
|
||||
# window border colors and terminal bell colors
|
||||
active_border_color ${teal.toHex()}
|
||||
inactive_border_color ${stope.toHex()}
|
||||
bell_border_color ${orange.toHex()}
|
||||
# visual_bell_color none
|
||||
####################
|
||||
|
||||
`
|
||||
}
|
||||
|
||||
export function colorsTabBar(): string {
|
||||
return `#########################
|
||||
# Tab bar colors
|
||||
active_tab_foreground ${text.toHex()}
|
||||
active_tab_background ${depths.toHex()}
|
||||
inactive_tab_foreground ${text.toHex()}
|
||||
inactive_tab_background ${stope.toHex()}
|
||||
# tab_bar_background #{pit.toHex()}
|
||||
# tab_bar_margin_color none
|
||||
####################
|
||||
|
||||
`
|
||||
}
|
||||
|
||||
export function colorsMarks(): string {
|
||||
return `#########################
|
||||
# Marks colors
|
||||
# mark1_foreground black
|
||||
# mark1_background #98d3cb
|
||||
# mark2_foreground black
|
||||
# mark2_background #f2dcd3
|
||||
# mark3_foreground black
|
||||
# mark3_background #f274bc
|
||||
####################
|
||||
|
||||
`
|
||||
}
|
||||
|
||||
export function colorsBasic16(): string {
|
||||
return `#########################
|
||||
# The basic 16 colors
|
||||
#: black
|
||||
color0 ${pit.toHex()}
|
||||
color8 ${stope.toHex()}
|
||||
|
||||
#: red
|
||||
color1 ${red.toHex()}
|
||||
color9 ${red.toHex()}
|
||||
|
||||
#: green
|
||||
color2 ${green.toHex()}
|
||||
color10 ${green.toHex()}
|
||||
|
||||
#: yellow
|
||||
color3 ${yellow.toHex()}
|
||||
color11 ${yellow.toHex()}
|
||||
|
||||
#: blue
|
||||
color4 ${blue.toHex()}
|
||||
color12 ${blue.toHex()}
|
||||
|
||||
#: magenta
|
||||
color5 ${purple.toHex()}
|
||||
color13 ${purple.toHex()}
|
||||
|
||||
#: cyan
|
||||
color6 ${teal.toHex()}
|
||||
color14 ${teal.toHex()}
|
||||
|
||||
#: white
|
||||
color7 ${text.toHex()}
|
||||
color15 ${text.toHex()}
|
||||
####################`
|
||||
}
|
||||
|
||||
|
|
91
ports/kitty/src/templates/kitty.conf.hbs
Normal file
91
ports/kitty/src/templates/kitty.conf.hbs
Normal file
|
@ -0,0 +1,91 @@
|
|||
#########################
|
||||
# {{name}} for kitty
|
||||
# {{version}}
|
||||
# {{license}}
|
||||
# {{url}}
|
||||
####################
|
||||
|
||||
#########################
|
||||
# The basic colors
|
||||
foreground {{text}}
|
||||
background {{pit}}
|
||||
selection_foreground {{depths}}
|
||||
selection_background {{text}}
|
||||
####################
|
||||
|
||||
#########################
|
||||
# Cursor colors
|
||||
cursor {{text}}
|
||||
cursor_text_color {{depths}}
|
||||
cursor_trail_color {{yellow}}
|
||||
####################
|
||||
|
||||
#########################
|
||||
# URL colors
|
||||
url_color {{blue}}
|
||||
####################
|
||||
|
||||
#########################
|
||||
# window border colors and terminal bell colors
|
||||
active_border_color {{teal}}
|
||||
inactive_border_color {{stope}}
|
||||
bell_border_color {{orange}}
|
||||
# visual_bell_color none
|
||||
####################
|
||||
|
||||
|
||||
#########################
|
||||
# Tab bar colors
|
||||
active_tab_foreground {{text}}
|
||||
active_tab_background {{depths}}
|
||||
inactive_tab_foreground {{text}}
|
||||
inactive_tab_background {{stope}}
|
||||
# tab_bar_background {{pit}}
|
||||
# tab_bar_margin_color none
|
||||
####################
|
||||
|
||||
#########################
|
||||
# Marks colors
|
||||
# mark1_foreground black
|
||||
# mark1_background #98d3cb
|
||||
# mark2_foreground black
|
||||
# mark2_background #f2dcd3
|
||||
# mark3_foreground black
|
||||
# mark3_background #f274bc
|
||||
####################
|
||||
|
||||
|
||||
#########################
|
||||
# The basic 16 colors
|
||||
#: black
|
||||
color0 {{pit}}
|
||||
color8 {{stope}}
|
||||
|
||||
#: red
|
||||
color1 {{red}}
|
||||
color9 {{red}}
|
||||
|
||||
#: green
|
||||
color2 {{green}}
|
||||
color10 {{green}}
|
||||
|
||||
#: yellow
|
||||
color3 {{yellow}}
|
||||
color11 {{yellow}}
|
||||
|
||||
#: blue
|
||||
color4 {{blue}}
|
||||
color12 {{blue}}
|
||||
|
||||
#: magenta
|
||||
color5 {{purple}}
|
||||
color13 {{purple}}
|
||||
|
||||
#: cyan
|
||||
color6 {{teal}}
|
||||
color14 {{teal}}
|
||||
|
||||
#: white
|
||||
color7 {{text}}
|
||||
color15 {{text}}
|
||||
####################
|
|
@ -91,6 +91,20 @@ export const purple = new Color('Purple', {
|
|||
h: absDegrees(hueLevels.teal + (hueOffset * 5)),
|
||||
})
|
||||
|
||||
export type Colors = {
|
||||
pit: string;
|
||||
depths: string;
|
||||
stope: string;
|
||||
text: string;
|
||||
orange: string;
|
||||
teal: string;
|
||||
red: string;
|
||||
yellow: string;
|
||||
green: string;
|
||||
blue: string;
|
||||
purple: string;
|
||||
}
|
||||
|
||||
export default [
|
||||
pit,
|
||||
depths,
|
||||
|
|
Loading…
Add table
Reference in a new issue