diff --git a/generate-themes.nu b/generate-themes.nu index 40e671c..dffce1b 100755 --- a/generate-themes.nu +++ b/generate-themes.nu @@ -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 diff --git a/themes/gruber.nix b/themes/gruber.nix index 8060056..3c212df 100644 --- a/themes/gruber.nix +++ b/themes/gruber.nix @@ -1,6 +1,6 @@ { name = "Gruber"; - author = "Patel; Nimai ; colors from www.github.com/rexim/gruber-darker-theme"; + author = "Patel, Nimai , colors from www.github.com/rexim/gruber-darker-theme"; base00 = "181818"; base01 = "453D41"; base02 = "484848"; diff --git a/themes/gruvbox-dark-hard.nix b/themes/gruvbox-dark-hard.nix index caa2e16..acf6d35 100644 --- a/themes/gruvbox-dark-hard.nix +++ b/themes/gruvbox-dark-hard.nix @@ -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"; diff --git a/themes/gruvbox-dark-medium.nix b/themes/gruvbox-dark-medium.nix index 7f0946d..fb8369b 100644 --- a/themes/gruvbox-dark-medium.nix +++ b/themes/gruvbox-dark-medium.nix @@ -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"; diff --git a/themes/gruvbox-dark-pale.nix b/themes/gruvbox-dark-pale.nix index aff0d46..fdcaf1c 100644 --- a/themes/gruvbox-dark-pale.nix +++ b/themes/gruvbox-dark-pale.nix @@ -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"; diff --git a/themes/gruvbox-dark-soft.nix b/themes/gruvbox-dark-soft.nix index 8f8ca63..c33e4fc 100644 --- a/themes/gruvbox-dark-soft.nix +++ b/themes/gruvbox-dark-soft.nix @@ -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"; diff --git a/themes/gruvbox-light-hard.nix b/themes/gruvbox-light-hard.nix index b727f75..57dfe98 100644 --- a/themes/gruvbox-light-hard.nix +++ b/themes/gruvbox-light-hard.nix @@ -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"; diff --git a/themes/gruvbox-light-medium.nix b/themes/gruvbox-light-medium.nix index 52b22b6..cae5e00 100644 --- a/themes/gruvbox-light-medium.nix +++ b/themes/gruvbox-light-medium.nix @@ -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"; diff --git a/themes/gruvbox-light-soft.nix b/themes/gruvbox-light-soft.nix index d6a13ae..12847ec 100644 --- a/themes/gruvbox-light-soft.nix +++ b/themes/gruvbox-light-soft.nix @@ -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"; diff --git a/themes/gruvbox-material-dark-hard.nix b/themes/gruvbox-material-dark-hard.nix index 84b3615..1d9594a 100644 --- a/themes/gruvbox-material-dark-hard.nix +++ b/themes/gruvbox-material-dark-hard.nix @@ -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"; diff --git a/themes/gruvbox-material-dark-medium.nix b/themes/gruvbox-material-dark-medium.nix index d2d9d15..ebf1c2f 100644 --- a/themes/gruvbox-material-dark-medium.nix +++ b/themes/gruvbox-material-dark-medium.nix @@ -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"; diff --git a/themes/gruvbox-material-dark-soft.nix b/themes/gruvbox-material-dark-soft.nix index 2e1e894..3707cc7 100644 --- a/themes/gruvbox-material-dark-soft.nix +++ b/themes/gruvbox-material-dark-soft.nix @@ -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"; diff --git a/themes/gruvbox-material-light-hard.nix b/themes/gruvbox-material-light-hard.nix index b5b2931..86faadb 100644 --- a/themes/gruvbox-material-light-hard.nix +++ b/themes/gruvbox-material-light-hard.nix @@ -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"; diff --git a/themes/gruvbox-material-light-medium.nix b/themes/gruvbox-material-light-medium.nix index 1525561..37b4696 100644 --- a/themes/gruvbox-material-light-medium.nix +++ b/themes/gruvbox-material-light-medium.nix @@ -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"; diff --git a/themes/gruvbox-material-light-soft.nix b/themes/gruvbox-material-light-soft.nix index 355e03a..0a584fa 100644 --- a/themes/gruvbox-material-light-soft.nix +++ b/themes/gruvbox-material-light-soft.nix @@ -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"; diff --git a/themes/nova.nix b/themes/nova.nix index 8359c75..9f7e2c1 100644 --- a/themes/nova.nix +++ b/themes/nova.nix @@ -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"; diff --git a/themes/oceanicnext.nix b/themes/oceanicnext.nix index 1272a58..60df8d0 100644 --- a/themes/oceanicnext.nix +++ b/themes/oceanicnext.nix @@ -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"; diff --git a/themes/spaceduck.nix b/themes/spaceduck.nix index 79fce0e..68d11e9 100644 --- a/themes/spaceduck.nix +++ b/themes/spaceduck.nix @@ -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"; diff --git a/themes/standardized-dark.nix b/themes/standardized-dark.nix index cbb65e2..6f1e321 100644 --- a/themes/standardized-dark.nix +++ b/themes/standardized-dark.nix @@ -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"; diff --git a/themes/standardized-light.nix b/themes/standardized-light.nix index 76fd17d..2902878 100644 --- a/themes/standardized-light.nix +++ b/themes/standardized-light.nix @@ -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"; diff --git a/themes/tango.nix b/themes/tango.nix index 8b6ae4d..d25dcd3 100644 --- a/themes/tango.nix +++ b/themes/tango.nix @@ -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";