From e8704dfcafabf9fa5405472f5c5937a80ba148f0 Mon Sep 17 00:00:00 2001 From: Ava Gaiety W Date: Fri, 19 Sep 2025 21:50:43 -0600 Subject: [PATCH] kitty port --- ports/kitty/README.md | 0 ports/kitty/dist/kitty.conf | 89 ++++++++++++++++++ ports/kitty/dist/palette.toml | 6 ++ ports/kitty/index.ts | 3 + ports/kitty/info.toml | 3 + ports/kitty/src/build.ts | 165 ++++++++++++++++++++++++++++++++++ 6 files changed, 266 insertions(+) create mode 100644 ports/kitty/README.md create mode 100644 ports/kitty/dist/kitty.conf create mode 100644 ports/kitty/dist/palette.toml create mode 100644 ports/kitty/index.ts create mode 100644 ports/kitty/info.toml create mode 100644 ports/kitty/src/build.ts diff --git a/ports/kitty/README.md b/ports/kitty/README.md new file mode 100644 index 0000000..e69de29 diff --git a/ports/kitty/dist/kitty.conf b/ports/kitty/dist/kitty.conf new file mode 100644 index 0000000..4a3193b --- /dev/null +++ b/ports/kitty/dist/kitty.conf @@ -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 +#################### \ No newline at end of file diff --git a/ports/kitty/dist/palette.toml b/ports/kitty/dist/palette.toml new file mode 100644 index 0000000..80e36ab --- /dev/null +++ b/ports/kitty/dist/palette.toml @@ -0,0 +1,6 @@ +######################### +# verdigris for kitty +# 0.0.1 +# GPL-3.0-only +# https://git.basking.monster/gaiety/verdigris +#################### \ No newline at end of file diff --git a/ports/kitty/index.ts b/ports/kitty/index.ts new file mode 100644 index 0000000..797f965 --- /dev/null +++ b/ports/kitty/index.ts @@ -0,0 +1,3 @@ +import BuildKitty from './src/build' + +await BuildKitty() diff --git a/ports/kitty/info.toml b/ports/kitty/info.toml new file mode 100644 index 0000000..4be1bcb --- /dev/null +++ b/ports/kitty/info.toml @@ -0,0 +1,3 @@ +name = "verdigris for kitty" +version = "0.0.1" + diff --git a/ports/kitty/src/build.ts b/ports/kitty/src/build.ts new file mode 100644 index 0000000..c1fe0fe --- /dev/null +++ b/ports/kitty/src/build.ts @@ -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 { + 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()} +####################` +}