1
Fork 0
mirror of https://github.com/RGBCube/ThemeNix synced 2025-07-27 08:27:45 +00:00

Fix generation

This commit is contained in:
RGBCube 2023-11-29 17:54:12 +03:00
parent ccd52c1beb
commit fc43add106
No known key found for this signature in database
21 changed files with 59 additions and 63 deletions

View file

@ -4,33 +4,22 @@ def theme-to-nix [
theme: record, # The theme to convert to Nix.
] {
$theme
| to json
| lines
| each { |line|
if ($line | str trim | str starts-with '"base') {
let line_parts = $line
| str replace '"' ""
| str replace '"' ""
| str replace "," ";"
| split row ": "
let line = $line_parts.0 + " = " + ($line_parts.1 | str upcase)
if not ($line | str ends-with ";") {
$line + ";"
} else {
$line
}
} else {
$line
| str replace "scheme" "name "
| str replace '"' ""
| str replace '"' ""
| str replace ":" " ="
| str replace --all "," ";"
| items { |key, value|
let key = match $key {
"scheme" => "name "
_ => $key
}
let value = if ($key | str starts-with "base0") {
$value | str upcase
} else {
$value
}
" " + $key + ' = "' + $value + '";'
}
| append ""
| prepend "{"
| append "}\n"
| str join "\n"
}
@ -38,8 +27,7 @@ def generate-valid-themes [] {
echo "generating themes.nix..."
ls themes
| each { $in.name | str replace ".nix" "" }
| each { |it| ' "' + ($it | path basename) + '" = import ./' + $it + ".nix;" }
| each { |it| ' "' + ($it.name | path parse | get stem) + '" = import ./' + $it.name + ";" }
| prepend "{"
| append "}\n"
| str join "\n"
@ -57,14 +45,22 @@ def main [] {
cd ..
}
echo "deleting old themes..."
rm -rf themes
mkdir themes
ls base16-schemes
| filter { ($in.name | str ends-with ".yml") or ($in.name | str ends-with ".yaml") }
| filter {
let extension = ($in.name | path parse | get extension)
$extension == "yml" or $extension == "yaml"
}
| each { |it|
let new_path = "themes/" + ($it.name | path basename | split row "." | first) + ".nix"
let new_path = "themes/" + ($it.name | path parse | get stem) + ".nix"
echo $"converting ($it.name) to ($new_path)..."
theme-to-nix (open $it.name) | save --force $new_path
theme-to-nix (open $it.name) | save $new_path
}
generate-valid-themes

View file

@ -1,6 +1,6 @@
{
name = "Gruber";
author = "Patel; Nimai <nimai.m.patel@gmail.com>; colors from www.github.com/rexim/gruber-darker-theme";
author = "Patel, Nimai <nimai.m.patel@gmail.com>, colors from www.github.com/rexim/gruber-darker-theme";
base00 = "181818";
base01 = "453D41";
base02 = "484848";

View file

@ -1,6 +1,6 @@
{
name = "Gruvbox dark; hard";
author = "Dawid Kurek (dawikur@gmail.com); morhetz (https://github.com/morhetz/gruvbox)";
name = "Gruvbox dark, hard";
author = "Dawid Kurek (dawikur@gmail.com), morhetz (https://github.com/morhetz/gruvbox)";
base00 = "1D2021";
base01 = "3C3836";
base02 = "504945";

View file

@ -1,6 +1,6 @@
{
name = "Gruvbox dark; medium";
author = "Dawid Kurek (dawikur@gmail.com); morhetz (https://github.com/morhetz/gruvbox)";
name = "Gruvbox dark, medium";
author = "Dawid Kurek (dawikur@gmail.com), morhetz (https://github.com/morhetz/gruvbox)";
base00 = "282828";
base01 = "3C3836";
base02 = "504945";

View file

@ -1,6 +1,6 @@
{
name = "Gruvbox dark; pale";
author = "Dawid Kurek (dawikur@gmail.com); morhetz (https://github.com/morhetz/gruvbox)";
name = "Gruvbox dark, pale";
author = "Dawid Kurek (dawikur@gmail.com), morhetz (https://github.com/morhetz/gruvbox)";
base00 = "262626";
base01 = "3A3A3A";
base02 = "4E4E4E";

View file

@ -1,6 +1,6 @@
{
name = "Gruvbox dark; soft";
author = "Dawid Kurek (dawikur@gmail.com); morhetz (https://github.com/morhetz/gruvbox)";
name = "Gruvbox dark, soft";
author = "Dawid Kurek (dawikur@gmail.com), morhetz (https://github.com/morhetz/gruvbox)";
base00 = "32302F";
base01 = "3C3836";
base02 = "504945";

View file

@ -1,6 +1,6 @@
{
name = "Gruvbox light; hard";
author = "Dawid Kurek (dawikur@gmail.com); morhetz (https://github.com/morhetz/gruvbox)";
name = "Gruvbox light, hard";
author = "Dawid Kurek (dawikur@gmail.com), morhetz (https://github.com/morhetz/gruvbox)";
base00 = "F9F5D7";
base01 = "EBDBB2";
base02 = "D5C4A1";

View file

@ -1,6 +1,6 @@
{
name = "Gruvbox light; medium";
author = "Dawid Kurek (dawikur@gmail.com); morhetz (https://github.com/morhetz/gruvbox)";
name = "Gruvbox light, medium";
author = "Dawid Kurek (dawikur@gmail.com), morhetz (https://github.com/morhetz/gruvbox)";
base00 = "FBF1C7";
base01 = "EBDBB2";
base02 = "D5C4A1";

View file

@ -1,6 +1,6 @@
{
name = "Gruvbox light; soft";
author = "Dawid Kurek (dawikur@gmail.com); morhetz (https://github.com/morhetz/gruvbox)";
name = "Gruvbox light, soft";
author = "Dawid Kurek (dawikur@gmail.com), morhetz (https://github.com/morhetz/gruvbox)";
base00 = "F2E5BC";
base01 = "EBDBB2";
base02 = "D5C4A1";

View file

@ -1,6 +1,6 @@
{
name = "Gruvbox Material Dark; Hard";
author = "Mayush Kumar (https://github.com/MayushKumar); sainnhe (https://github.com/sainnhe/gruvbox-material-vscode)";
name = "Gruvbox Material Dark, Hard";
author = "Mayush Kumar (https://github.com/MayushKumar), sainnhe (https://github.com/sainnhe/gruvbox-material-vscode)";
base00 = "202020";
base01 = "2A2827";
base02 = "504945";

View file

@ -1,6 +1,6 @@
{
name = "Gruvbox Material Dark; Medium";
author = "Mayush Kumar (https://github.com/MayushKumar); sainnhe (https://github.com/sainnhe/gruvbox-material-vscode)";
name = "Gruvbox Material Dark, Medium";
author = "Mayush Kumar (https://github.com/MayushKumar), sainnhe (https://github.com/sainnhe/gruvbox-material-vscode)";
base00 = "292828";
base01 = "32302F";
base02 = "504945";

View file

@ -1,6 +1,6 @@
{
name = "Gruvbox Material Dark; Soft";
author = "Mayush Kumar (https://github.com/MayushKumar); sainnhe (https://github.com/sainnhe/gruvbox-material-vscode)";
name = "Gruvbox Material Dark, Soft";
author = "Mayush Kumar (https://github.com/MayushKumar), sainnhe (https://github.com/sainnhe/gruvbox-material-vscode)";
base00 = "32302F";
base01 = "3C3836";
base02 = "5A524C";

View file

@ -1,6 +1,6 @@
{
name = "Gruvbox Material Light; Hard";
author = "Mayush Kumar (https://github.com/MayushKumar); sainnhe (https://github.com/sainnhe/gruvbox-material-vscode)";
name = "Gruvbox Material Light, Hard";
author = "Mayush Kumar (https://github.com/MayushKumar), sainnhe (https://github.com/sainnhe/gruvbox-material-vscode)";
base00 = "F9F5D7";
base01 = "FBF1C7";
base02 = "E0CFA9";

View file

@ -1,6 +1,6 @@
{
name = "Gruvbox Material Light; Medium";
author = "Mayush Kumar (https://github.com/MayushKumar); sainnhe (https://github.com/sainnhe/gruvbox-material-vscode)";
name = "Gruvbox Material Light, Medium";
author = "Mayush Kumar (https://github.com/MayushKumar), sainnhe (https://github.com/sainnhe/gruvbox-material-vscode)";
base00 = "FBF1C7";
base01 = "F2E5BC";
base02 = "D5C4A1";

View file

@ -1,6 +1,6 @@
{
name = "Gruvbox Material Light; Soft";
author = "Mayush Kumar (https://github.com/MayushKumar); sainnhe (https://github.com/sainnhe/gruvbox-material-vscode)";
name = "Gruvbox Material Light, Soft";
author = "Mayush Kumar (https://github.com/MayushKumar), sainnhe (https://github.com/sainnhe/gruvbox-material-vscode)";
base00 = "F2E5BC";
base01 = "EBDBB2";
base02 = "C9B99A";

View file

@ -1,6 +1,6 @@
{
name = "Nova";
author = "George Essig (https://github.com/gessig); Trevor D. Miller (https://trevordmiller.com)";
author = "George Essig (https://github.com/gessig), Trevor D. Miller (https://trevordmiller.com)";
base00 = "3C4C55";
base01 = "556873";
base02 = "6A7D89";

View file

@ -1,6 +1,6 @@
{
name = "OceanicNext";
author = "https://github.com/voronianski/oceanic-next-color-name ";
author = "https://github.com/voronianski/oceanic-next-color-scheme";
base00 = "1B2B34";
base01 = "343D46";
base02 = "4F5B66";

View file

@ -1,6 +1,6 @@
{
name = "Spaceduck";
author = "Guillermo Rodriguez (https://github.com/pineapplegiant); packaged by Gabriel Fontes (https://github.com/Misterio77)";
author = "Guillermo Rodriguez (https://github.com/pineapplegiant), packaged by Gabriel Fontes (https://github.com/Misterio77)";
base00 = "16172D";
base01 = "1B1C36";
base02 = "30365F";

View file

@ -1,6 +1,6 @@
{
name = "standardized-dark";
author = "ali (https://github.com/ali-githb/base16-standardized-name )";
author = "ali (https://github.com/ali-githb/base16-standardized-scheme)";
base00 = "222222";
base01 = "303030";
base02 = "555555";

View file

@ -1,6 +1,6 @@
{
name = "standardized-light";
author = "ali (https://github.com/ali-githb/base16-standardized-name )";
author = "ali (https://github.com/ali-githb/base16-standardized-scheme)";
base00 = "FFFFFF";
base01 = "EEEEEE";
base02 = "CCCCCC";

View file

@ -1,6 +1,6 @@
{
name = "Tango";
author = "@Schnouki; based on the Tango Desktop Project";
author = "@Schnouki, based on the Tango Desktop Project";
base00 = "2E3436";
base01 = "8AE234";
base02 = "FCE94F";