Commit Graph

4 Commits

Author SHA1 Message Date
Antoine Stevan
b9ec76b493
rewrite the theme generation (#437)
* remove the template

* update the theme generation script

* fix the local path to the lemnos themes

* use the real `export der main` module template

* remove the empty lines and the comments from theme files

* adapt the default config file theme to the template

This commit uses closures for `filesize`, `date` and `bool`.

* put quotes around all the colors in the template

* fix the `else` of `filesize` => returns a true record now

* use default colors for the filesize

* regenerate all the themes with `./make.nu`
2023-04-05 12:52:15 -05:00
Antoine Stevan
b5b7ae1410
FIX: define a main function to use the themes modules (#402)
* change the main command of the themes to `main`

Command used:
```
sd 'export def .* \[\] \{' 'export def main [] {' themes/themes/**/*
```

This commit mitigates the following equivalent error
```
>_ module spam { export def spam [] { "this is spam::spam" } }
Error: nu::parser::named_as_module

  × Can't export command named same as the module.
   ╭─[entry #74:1:1]
 1 │ module spam { export def spam [] { "this is spam::spam" } }
   ·                          ──┬─
   ·                            ╰── can't export from module spam
   ╰────
  help: Module spam can't export command named the same as the module. Either change the module name, or export `main`
        custom command.
```
when running `use themes/themes/dracula.nu` for instance.

* change the template as well to define a `main` function

* do not use * from the theme modules, they define a `main` function
2023-03-20 08:51:14 -05:00
WindSoilder
106e56f48b
Update README.md (#372) 2023-02-03 06:25:50 -06:00
Antoine Stevan
bdfed700a4
add a collection of colorschemes for nushell (#286)
* add my personal color config files

remove the useless colors.nu script

* add all lemnos theme files as a submodule

* add a template module from the default dark theme

the `map.csv` file:
```csv
code,bold,bash,nushell
0,false,black,black
1,false,red,red
2,false,green,green
3,false,yellow,yellow
4,false,blue,blue
5,false,magenta,purple
6,false,cyan,cyan
7,false,white,light_gray
8,true,black,dark_gray
9,true,red,red_bold
10,true,green,green_bold
11,true,yellow,yellow_bold
12,true,blue,blue_bold
13,true,magenta,purple_bold
14,true,cyan,light_cyan
14,true,cyan,cyan_bold
15,true,white,white
```

the command used was
```nushell
open map.csv |
each {
    |it|
    sed -i $"s/: ($it.nushell)$/: \"{{color($it.code)}}\"/" template.nu
}
```
or as a oneliner
```nushell
open map.csv | each {|it| sed -i $"s/: ($it.nushell)$/: \"{{color($it.code)}}\"/" template.nu}
```

* add a script to make all the scripts at once

* make all the themes

* add a README with some credits to lemnos

* add usage instructions to the README

* add desired values to the template

This commit adds the background, the foreground and the cursor
colors to the themes as commented lines.
These do not fit into any nushell theme as they should be set by the
terminal emulator, but they are included here for completeness.

Addresses https://github.com/nushell/nu_scripts/pull/286#issuecomment-1230814914

* regenerate the themes with the new template

* remove all the occurences of sed by str replace

* remove the lemnos submodule

Co-authored-by: amtoine <44101798+AntoineStevan@users.noreply.github.com>
2022-09-07 13:48:28 -05:00