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

12 commits

Author SHA1 Message Date
Cong Luan Tran
765555bedd
fix Tokyonight Moon theme color (#1125)
Previously, this doesn't follow the Moon pallette
2025-05-22 11:09:50 -05:00
Alexandre CONTASSOT
4bc37c125f
Fix datetime theme color (#1111)
In Nushell 0.104.0, `date` are now `datetime` ([see
blog](https://www.nushell.sh/blog/2025-04-29-nushell_0_104_0.html#date-is-now-datetime-toc)).

I just change all `date` prop to `datetime` in all themes to fix them
2025-05-03 08:00:56 -05:00
Alexandre CONTASSOT
7bf4491cbf
Add catppuccin macchiato theme (#935) 2024-08-19 14:08:37 +02:00
NotTheDr01ds
9a12d8df39
Additional Theme Features (#925)
Changes to `make.nu`:

* Adds in missing shapes and types noted further down in this PR by
@fdncred
* Adds colors for types - Mostly matching the corresponding shape, but
with any attribute (e.g., bold) removed
* Changed `int` and `float` values to be distinct. In most themes, the
colors should be complementary.
* Changes `bool: false` and `hints` colors - They were hardcoded to
`dark_grey` and wouldn't show up on some themes. Now uses a theme color
that should correspond to a theme-appropriate grey in most cases.
* Alphabetizes shapes and types so that Previews are also sorted
properly
* Eliminated spurious newline when sourcing theme (from printing OSC
codes for terminal colors)
* Renamed `3024` theme to `3024r` since module names can't be an `int`

Changes to `theme preview small`:

* Remove extra vertical spacing that was caused by different-sized row
column content
* Logically group elements - Types, Conditionally computed (closures)
types, Shapes, and other Structure (e.g., header, row_index, foreground,
etc.)
* Displays foreground/background on one line for clarity

Result is a much more compact, but also more readable, table.

Comparison:

<details><summary>Before</summary>
<p>
<img
src="https://github.com/user-attachments/assets/2673855d-d20d-4e14-8029-255138f2ecc9"
/>
</p>
</details> 

<details><summary>After</summary>
<p>
<img
src="https://github.com/user-attachments/assets/c8824b7a-440d-4567-bd69-b2e1df358340"
/>
</p>
</details> 

* Also refactored a lot of the code to be more maintainable - Moves the
rendering off to separate functions.

Changes to `preview_generate_screenshots.nu`:

* Accepts the method for generating screenshots as an argument
* Additional generation method using asciinema, agg (asciinema to
animated gif), and ffmpeg (to convert the animated gif to a single-image
PNG)

Additional Notes:

- Some Lemnos themes use color values that are the same (or nearly the
same) as the background in places. These are "broken" themes and always
have been as some elements will simply not be visible.

- There's a longstanding (I believe) bug that special-cased `record` for
the *key* rather than the *value*. I've fixed it so that the *key* is
now handled properly (same as other types), but I haven't implemented
any changes for color values that use a record (e.g., `{ fg: "#80a1a1",
attr: "b" }`) as this would make the table less compact. I'll look at
doing this for the longer form `preview theme` later.

- Closures other than for `string`, `bool`, `date`, and `filesize` are
currently only displayed as a summary. There aren't any themes currently
that this impacts, but if you create one manually, the display results
were pretty bad. This is primarily due to bad indentation from
`config.nu` (and/or defaults). A proper `nu-indent` would help fix this,
or maybe we could just remove all whitespace and display any closure as
a one-liner.

I probably won't regenerate screenshots until we figure out what to do
about the "monotone" type colors.
2024-07-29 17:08:13 -05:00
NotTheDr01ds
995c1ea21c
Update theme preview scripts and screenshots (#909)
Lots of changes - Pretty every change needed to be made before updating
the preview screenshots, so they all end up in the same PR here:

* `preview-generate-screenshots.nu` now generates the previews and
screenshots all in one pass rather than requiring a separate file.

* Adds a new method for generating screenshots using PowerShell with no
third-party application required. Created new function for choosing the
method that is used to generate screenshots.

* Fixes background color on `nushell-dark` and `nushell-light` themes.

* Fixes bug where `cursor` setting (and perhaps one other) was getting
dropped from the preview table (`math ceil` was needed rather than `math
floor`)

* Fixes `cellpath` setting - Was changed to `cell-path` a while back but
never updated in the themes. All themes and their previews were
regenerated. Custom themes were manually adjusted.

* **Important:** I did not update `make.nu` to fix this (yet) since
@amtoine has a open PR against it that has not been merged yet. Easier
to either put that change in that PR or do it after that one has been
merged.

* Adds `mod.nu` in the root of the `themes` module. Moves some of the
previous script commands such as `preview_terminal`,
`preview_theme_small`, etc. over to the module. Makes for cleaner usage.

* Note: The completion functions in the scripts have been broken for
several months. I did not fix this at this point.

* `preview_theme_small` (and others) renamed to use spaces in command
name, so it is now `preview theme small`.

* Fixes bug of my own making that prevented several custom themes from
working.

* Refactors the "list to columns" code to use `group` (will need to be
updated to `chunks` in 0.96)
* Suppresses the indices column in the preview table
* Removes the column headers entirely since they don't serve any purpose
in this type of "columnar table"
2024-07-22 14:21:28 -05:00
OJarrisonn_
be32cdaefc
fix: catppuccin themes declared a const inside a record (#907) 2024-07-21 07:00:51 -05:00
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
winston
66c76a9dbd
fix: adjust for nushell commandline syntax deprecation (#840)
Fixes for changes introduced by
https://github.com/nushell/nushell/pull/12658
2024-05-19 13:33:08 -05:00
Alexis Praga
74f23a4980
Support for catppuccin-latte (#741)
Complete the support for catppucin-mocha.

It looks like there's work for a better way to manage that (
https://github.com/catppuccin/catppuccin/discussions/2140 ) but this can
help other people.
2024-03-07 06:18:50 -06:00
adrian5
b23755c895
Add tokyo-moon theme variant (#710)
Closes #702. I was wrong in thinking the "night" and "storm" variants
should be much different — they're not. It's the divergent "moon"
variant between them that was missing. Added.

I have slight doubts about the darker gray `#828bb8` being used for e.g.
`ls` columns, but I think that basically correct. The high-contrast
foreground color `#c8d3f5` is the bright variant of that and should show
up in most other contexts I reckon.
2023-12-21 18:08:34 -06:00
Antoine Stevan
cc0719bdad
make the themes a module (#648)
related to
- https://github.com/nushell/nupm/pull/33

## description
with https://github.com/nushell/nupm/pull/33, Nupm can now install
separate modules from a single package 🥳

the `nu_scripts` are a package and looks like they contain a few
potential standalone modules:
- the themes
- the hooks
- the custom completions
- ...

this PR is a proposal to move `themes/` to `nu-themes/` and add
`./nu-themes/` as a module to the `nu-scripts` package.
that way when running `nupm install --path .` in the root of the
`nu_scripts`, a `nu-themes` module will be installed in
`$env.NUPM_HOME/modules`.

then one can run
```nushell
use nu-themes/themes/nushell-dark.nu
```
and next get the theme with
```nushell
nushell-dark
```
2023-10-23 18:25:04 +02:00