mirror of
https://github.com/RGBCube/ThemeNix
synced 2025-07-27 08:27:45 +00:00
Fix generation
This commit is contained in:
parent
ccd52c1beb
commit
fc43add106
21 changed files with 59 additions and 63 deletions
|
@ -4,33 +4,22 @@ def theme-to-nix [
|
||||||
theme: record, # The theme to convert to Nix.
|
theme: record, # The theme to convert to Nix.
|
||||||
] {
|
] {
|
||||||
$theme
|
$theme
|
||||||
| to json
|
| items { |key, value|
|
||||||
| lines
|
let key = match $key {
|
||||||
| each { |line|
|
"scheme" => "name "
|
||||||
if ($line | str trim | str starts-with '"base') {
|
_ => $key
|
||||||
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 "," ";"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let value = if ($key | str starts-with "base0") {
|
||||||
|
$value | str upcase
|
||||||
|
} else {
|
||||||
|
$value
|
||||||
|
}
|
||||||
|
|
||||||
|
" " + $key + ' = "' + $value + '";'
|
||||||
}
|
}
|
||||||
| append ""
|
| prepend "{"
|
||||||
|
| append "}\n"
|
||||||
| str join "\n"
|
| str join "\n"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,8 +27,7 @@ def generate-valid-themes [] {
|
||||||
echo "generating themes.nix..."
|
echo "generating themes.nix..."
|
||||||
|
|
||||||
ls themes
|
ls themes
|
||||||
| each { $in.name | str replace ".nix" "" }
|
| each { |it| ' "' + ($it.name | path parse | get stem) + '" = import ./' + $it.name + ";" }
|
||||||
| each { |it| ' "' + ($it | path basename) + '" = import ./' + $it + ".nix;" }
|
|
||||||
| prepend "{"
|
| prepend "{"
|
||||||
| append "}\n"
|
| append "}\n"
|
||||||
| str join "\n"
|
| str join "\n"
|
||||||
|
@ -57,14 +45,22 @@ def main [] {
|
||||||
cd ..
|
cd ..
|
||||||
}
|
}
|
||||||
|
|
||||||
|
echo "deleting old themes..."
|
||||||
|
rm -rf themes
|
||||||
|
mkdir themes
|
||||||
|
|
||||||
ls base16-schemes
|
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|
|
| 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)..."
|
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
|
generate-valid-themes
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
name = "Gruber";
|
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";
|
base00 = "181818";
|
||||||
base01 = "453D41";
|
base01 = "453D41";
|
||||||
base02 = "484848";
|
base02 = "484848";
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
name = "Gruvbox dark; hard";
|
name = "Gruvbox dark, hard";
|
||||||
author = "Dawid Kurek (dawikur@gmail.com); morhetz (https://github.com/morhetz/gruvbox)";
|
author = "Dawid Kurek (dawikur@gmail.com), morhetz (https://github.com/morhetz/gruvbox)";
|
||||||
base00 = "1D2021";
|
base00 = "1D2021";
|
||||||
base01 = "3C3836";
|
base01 = "3C3836";
|
||||||
base02 = "504945";
|
base02 = "504945";
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
name = "Gruvbox dark; medium";
|
name = "Gruvbox dark, medium";
|
||||||
author = "Dawid Kurek (dawikur@gmail.com); morhetz (https://github.com/morhetz/gruvbox)";
|
author = "Dawid Kurek (dawikur@gmail.com), morhetz (https://github.com/morhetz/gruvbox)";
|
||||||
base00 = "282828";
|
base00 = "282828";
|
||||||
base01 = "3C3836";
|
base01 = "3C3836";
|
||||||
base02 = "504945";
|
base02 = "504945";
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
name = "Gruvbox dark; pale";
|
name = "Gruvbox dark, pale";
|
||||||
author = "Dawid Kurek (dawikur@gmail.com); morhetz (https://github.com/morhetz/gruvbox)";
|
author = "Dawid Kurek (dawikur@gmail.com), morhetz (https://github.com/morhetz/gruvbox)";
|
||||||
base00 = "262626";
|
base00 = "262626";
|
||||||
base01 = "3A3A3A";
|
base01 = "3A3A3A";
|
||||||
base02 = "4E4E4E";
|
base02 = "4E4E4E";
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
name = "Gruvbox dark; soft";
|
name = "Gruvbox dark, soft";
|
||||||
author = "Dawid Kurek (dawikur@gmail.com); morhetz (https://github.com/morhetz/gruvbox)";
|
author = "Dawid Kurek (dawikur@gmail.com), morhetz (https://github.com/morhetz/gruvbox)";
|
||||||
base00 = "32302F";
|
base00 = "32302F";
|
||||||
base01 = "3C3836";
|
base01 = "3C3836";
|
||||||
base02 = "504945";
|
base02 = "504945";
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
name = "Gruvbox light; hard";
|
name = "Gruvbox light, hard";
|
||||||
author = "Dawid Kurek (dawikur@gmail.com); morhetz (https://github.com/morhetz/gruvbox)";
|
author = "Dawid Kurek (dawikur@gmail.com), morhetz (https://github.com/morhetz/gruvbox)";
|
||||||
base00 = "F9F5D7";
|
base00 = "F9F5D7";
|
||||||
base01 = "EBDBB2";
|
base01 = "EBDBB2";
|
||||||
base02 = "D5C4A1";
|
base02 = "D5C4A1";
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
name = "Gruvbox light; medium";
|
name = "Gruvbox light, medium";
|
||||||
author = "Dawid Kurek (dawikur@gmail.com); morhetz (https://github.com/morhetz/gruvbox)";
|
author = "Dawid Kurek (dawikur@gmail.com), morhetz (https://github.com/morhetz/gruvbox)";
|
||||||
base00 = "FBF1C7";
|
base00 = "FBF1C7";
|
||||||
base01 = "EBDBB2";
|
base01 = "EBDBB2";
|
||||||
base02 = "D5C4A1";
|
base02 = "D5C4A1";
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
name = "Gruvbox light; soft";
|
name = "Gruvbox light, soft";
|
||||||
author = "Dawid Kurek (dawikur@gmail.com); morhetz (https://github.com/morhetz/gruvbox)";
|
author = "Dawid Kurek (dawikur@gmail.com), morhetz (https://github.com/morhetz/gruvbox)";
|
||||||
base00 = "F2E5BC";
|
base00 = "F2E5BC";
|
||||||
base01 = "EBDBB2";
|
base01 = "EBDBB2";
|
||||||
base02 = "D5C4A1";
|
base02 = "D5C4A1";
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
name = "Gruvbox Material Dark; Hard";
|
name = "Gruvbox Material Dark, Hard";
|
||||||
author = "Mayush Kumar (https://github.com/MayushKumar); sainnhe (https://github.com/sainnhe/gruvbox-material-vscode)";
|
author = "Mayush Kumar (https://github.com/MayushKumar), sainnhe (https://github.com/sainnhe/gruvbox-material-vscode)";
|
||||||
base00 = "202020";
|
base00 = "202020";
|
||||||
base01 = "2A2827";
|
base01 = "2A2827";
|
||||||
base02 = "504945";
|
base02 = "504945";
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
name = "Gruvbox Material Dark; Medium";
|
name = "Gruvbox Material Dark, Medium";
|
||||||
author = "Mayush Kumar (https://github.com/MayushKumar); sainnhe (https://github.com/sainnhe/gruvbox-material-vscode)";
|
author = "Mayush Kumar (https://github.com/MayushKumar), sainnhe (https://github.com/sainnhe/gruvbox-material-vscode)";
|
||||||
base00 = "292828";
|
base00 = "292828";
|
||||||
base01 = "32302F";
|
base01 = "32302F";
|
||||||
base02 = "504945";
|
base02 = "504945";
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
name = "Gruvbox Material Dark; Soft";
|
name = "Gruvbox Material Dark, Soft";
|
||||||
author = "Mayush Kumar (https://github.com/MayushKumar); sainnhe (https://github.com/sainnhe/gruvbox-material-vscode)";
|
author = "Mayush Kumar (https://github.com/MayushKumar), sainnhe (https://github.com/sainnhe/gruvbox-material-vscode)";
|
||||||
base00 = "32302F";
|
base00 = "32302F";
|
||||||
base01 = "3C3836";
|
base01 = "3C3836";
|
||||||
base02 = "5A524C";
|
base02 = "5A524C";
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
name = "Gruvbox Material Light; Hard";
|
name = "Gruvbox Material Light, Hard";
|
||||||
author = "Mayush Kumar (https://github.com/MayushKumar); sainnhe (https://github.com/sainnhe/gruvbox-material-vscode)";
|
author = "Mayush Kumar (https://github.com/MayushKumar), sainnhe (https://github.com/sainnhe/gruvbox-material-vscode)";
|
||||||
base00 = "F9F5D7";
|
base00 = "F9F5D7";
|
||||||
base01 = "FBF1C7";
|
base01 = "FBF1C7";
|
||||||
base02 = "E0CFA9";
|
base02 = "E0CFA9";
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
name = "Gruvbox Material Light; Medium";
|
name = "Gruvbox Material Light, Medium";
|
||||||
author = "Mayush Kumar (https://github.com/MayushKumar); sainnhe (https://github.com/sainnhe/gruvbox-material-vscode)";
|
author = "Mayush Kumar (https://github.com/MayushKumar), sainnhe (https://github.com/sainnhe/gruvbox-material-vscode)";
|
||||||
base00 = "FBF1C7";
|
base00 = "FBF1C7";
|
||||||
base01 = "F2E5BC";
|
base01 = "F2E5BC";
|
||||||
base02 = "D5C4A1";
|
base02 = "D5C4A1";
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
name = "Gruvbox Material Light; Soft";
|
name = "Gruvbox Material Light, Soft";
|
||||||
author = "Mayush Kumar (https://github.com/MayushKumar); sainnhe (https://github.com/sainnhe/gruvbox-material-vscode)";
|
author = "Mayush Kumar (https://github.com/MayushKumar), sainnhe (https://github.com/sainnhe/gruvbox-material-vscode)";
|
||||||
base00 = "F2E5BC";
|
base00 = "F2E5BC";
|
||||||
base01 = "EBDBB2";
|
base01 = "EBDBB2";
|
||||||
base02 = "C9B99A";
|
base02 = "C9B99A";
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
name = "Nova";
|
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";
|
base00 = "3C4C55";
|
||||||
base01 = "556873";
|
base01 = "556873";
|
||||||
base02 = "6A7D89";
|
base02 = "6A7D89";
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
name = "OceanicNext";
|
name = "OceanicNext";
|
||||||
author = "https://github.com/voronianski/oceanic-next-color-name ";
|
author = "https://github.com/voronianski/oceanic-next-color-scheme";
|
||||||
base00 = "1B2B34";
|
base00 = "1B2B34";
|
||||||
base01 = "343D46";
|
base01 = "343D46";
|
||||||
base02 = "4F5B66";
|
base02 = "4F5B66";
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
name = "Spaceduck";
|
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";
|
base00 = "16172D";
|
||||||
base01 = "1B1C36";
|
base01 = "1B1C36";
|
||||||
base02 = "30365F";
|
base02 = "30365F";
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
name = "standardized-dark";
|
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";
|
base00 = "222222";
|
||||||
base01 = "303030";
|
base01 = "303030";
|
||||||
base02 = "555555";
|
base02 = "555555";
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
name = "standardized-light";
|
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";
|
base00 = "FFFFFF";
|
||||||
base01 = "EEEEEE";
|
base01 = "EEEEEE";
|
||||||
base02 = "CCCCCC";
|
base02 = "CCCCCC";
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
name = "Tango";
|
name = "Tango";
|
||||||
author = "@Schnouki; based on the Tango Desktop Project";
|
author = "@Schnouki, based on the Tango Desktop Project";
|
||||||
base00 = "2E3436";
|
base00 = "2E3436";
|
||||||
base01 = "8AE234";
|
base01 = "8AE234";
|
||||||
base02 = "FCE94F";
|
base02 = "FCE94F";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue