1
Fork 0
mirror of https://github.com/RGBCube/nu_scripts synced 2025-07-31 14:17:45 +00:00
Commit graph

8 commits

Author SHA1 Message Date
NotTheDr01ds
8557653047
Recover non-lemnos themes (#902)
Changes:

* Custom Nushell `color_config`'s (non-Lemnos) are moved to the
`./src/custom-nu-themes` directory and used to generate the main theme
files when doing a `./make.nu`
* `make.nu` and other scripts (e.g. preview) have been moved to the
`src` directory
* A separate `README` for the `src` scripts
* Main theme `README` updated for clarity
* Reordered the theme template, so all themes were regenerated. I'd like
to stop doing this ;-)

@amtoine Thanks for your suggestions on the `README`. I've pretty
extensively changed the flow, so please re-review and let me know how it
looks. Also note that I haven't personally tested with Nupm, so please
especially review this section. Thanks!

@fdncred CC

Still planning on working on the preview scripts next. They'll need only
slight changes to run (probably a path change), but they can be
simplified a bit now, I hope. At the same time, I'll complicate them in
other ways ;-).

Note that there is a bug in both `nushell-dark` and `nushell-light` that
prevented the terminal colors from being updated regardless. You can see
that in the existing screenshots, where both those themes simply re-use
the previous theme (alphabetically's) background. I haven't fixed this
yet.
2024-07-19 13:27:05 -05:00
NotTheDr01ds
bd1ab4e7a7
Simplify theme usage (#896)
* Primary change: Simplifies theme usage by adding an `export-env` to
each theme so that `$env.config.color_config` is automatically set when
importing the module.

  Rather than the old:

  ```nu
  use nu-themes/nushell-dark.nu
  $env.config.color_config = (nushell-dark)
  ```

  It's now a single-step:

  ```nu
  use nu-themes/nushell-dark.nu
  ```

* Updates `make.nu` to create the theme files (uses the previously added
`str dedent` for clean output).
* A couple (literally, 2) of the remote themes did not have all
necessary colors and failed. Updated `make.nu` to continue on error, but
report the failures.
* Updated `README.md`
2024-07-18 15:39:46 -05:00
Antoine Stevan
8add04deb8
update the nu-themes readme (#652)
related to
-
https://discord.com/channels/601130461678272522/601130461678272524/1167879553918705705

## description
this PR updates the README of the `nu-themes` module in the `nu-scripts`
package:
- fix the path with `themes/nu-themes/` instead of `themes/themes/`
- adds some instructions to use `nupm`

> **Note**
> see the [new README
here](https://github.com/amtoine/nu_scripts/tree/update-nu-themes-readme/themes#use-a-colorscheme)
2023-10-29 07:55:13 -05:00
Antoine Stevan
a61256da0e
use $env. instead of let-env (#543)
related to nushell/nushell#9574

Commands used
```nushell
sd --string-mode "let-env " '$env.' **/*
git rst before_v0.60/
```
2023-07-01 10:40:16 +02:00
Darren Schroeder
424e8d61a5
add screenshot link 2023-06-12 12:03:56 -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