kitty port

This commit is contained in:
Ava Gaiety W 2025-09-19 21:50:43 -06:00
parent 61b13c8533
commit e8704dfcaf
6 changed files with 266 additions and 0 deletions

0
ports/kitty/README.md Normal file
View file

89
ports/kitty/dist/kitty.conf vendored Normal file
View file

@ -0,0 +1,89 @@
#########################
# verdigris for kitty for kitty
# 0.0.1
# GPL-3.0-only
# https://git.basking.monster/gaiety/verdigris
####################
#########################
# The basic colors
foreground #C6E4F0
background #00040B
selection_foreground #19323B
selection_background #C6E4F0
####################
#########################
# Cursor colors
cursor #C6E4F0
cursor_text_color #19323B
# cursor_trail_color none
####################
#########################
# URL colors
url_color #8CC8E0
####################
#########################
# Marks colors
# mark1_foreground black
# mark1_background #98d3cb
# mark2_foreground black
# mark2_background #f2dcd3
# mark3_foreground black
# 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
#: black
color0 #00040B
color8 #4E6872
#: red
color1 #E8ADA9
color9 #E8ADA9
#: green
color2 #98CCAC
color10 #98CCAC
#: yellow
color3 #E1B392
color11 #E1B392
#: blue
color4 #8CC8E0
color12 #8CC8E0
#: magenta
color5 #BEB6E8
color13 #BEB6E8
#: cyan
color6 #23DBC1
color14 #23DBC1
#: white
color7 #C6E4F0
color15 #C6E4F0
####################

6
ports/kitty/dist/palette.toml vendored Normal file
View file

@ -0,0 +1,6 @@
#########################
# verdigris for kitty
# 0.0.1
# GPL-3.0-only
# https://git.basking.monster/gaiety/verdigris
####################

3
ports/kitty/index.ts Normal file
View file

@ -0,0 +1,3 @@
import BuildKitty from './src/build'
await BuildKitty()

3
ports/kitty/info.toml Normal file
View file

@ -0,0 +1,3 @@
name = "verdigris for kitty"
version = "0.0.1"

165
ports/kitty/src/build.ts Normal file
View file

@ -0,0 +1,165 @@
import { name, version } from '../info.toml'
import { license, url } from '../../../package.json'
import appRoot from 'app-root-path'
import { rmFile, mkFilePath, appendToFile } from "../../../src/helpers/file"
import {
pit,
depths,
stope,
text,
orange,
teal,
red,
yellow,
green,
blue,
purple,
} from '../../../src/palette'
const file = appRoot + '/ports/kitty/dist/kitty.conf'
const appendToKittyConf = async (content: string) => await appendToFile(file, content)
export default async function(isVerbose = false): Promise<string> {
console.log(file)
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())
return file
}
function headerInfo(): string {
return `#########################
# ${name} for kitty
# ${version}
# ${license}
# ${url}
####################
`
}
function colorsBasic(): string {
return `#########################
# The basic colors
foreground ${text.toHex()}
background ${pit.toHex()}
selection_foreground ${depths.toHex()}
selection_background ${text.toHex()}
####################
`
}
function colorsCursor(): string {
return `#########################
# Cursor colors
cursor ${text.toHex()}
cursor_text_color ${depths.toHex()}
# cursor_trail_color none
####################
`
}
function colorsURLs(): string {
return `#########################
# URL colors
url_color ${blue.toHex()}
####################
`
}
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
####################
`
}
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
####################
`
}
function colorsMarks(): string {
return `#########################
# Marks colors
# mark1_foreground black
# mark1_background #98d3cb
# mark2_foreground black
# mark2_background #f2dcd3
# mark3_foreground black
# mark3_background #f274bc
####################
`
}
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()}
####################`
}