1
Fork 0
mirror of https://github.com/RGBCube/nu_scripts synced 2025-08-03 15:47:47 +00:00

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"
This commit is contained in:
NotTheDr01ds 2024-07-22 15:21:28 -04:00 committed by GitHub
parent 770dfe6d4e
commit 995c1ea21c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
915 changed files with 1019 additions and 5353 deletions

View file

@ -1,86 +1,88 @@
# Retrieve the theme settings
export def main [] { return {
separator: "#a9b1d6"
leading_trailing_space_bg: { attr: "n" }
header: { fg: "#9ece6a" attr: "b" }
empty: "#7aa2f7"
bool: {|| if $in { "#7dcfff" } else { "light_gray" } }
int: "#a9b1d6"
filesize: {|e|
if $e == 0b {
"#a9b1d6"
} else if $e < 1mb {
"#7dcfff"
} else {{ fg: "#7aa2f7" }}
}
duration: "#a9b1d6"
date: {|| (date now) - $in |
if $in < 1hr {
{ fg: "#f7768e" attr: "b" }
} else if $in < 6hr {
"#f7768e"
} else if $in < 1day {
"#e0af68"
} else if $in < 3day {
"#9ece6a"
} else if $in < 1wk {
{ fg: "#9ece6a" attr: "b" }
} else if $in < 6wk {
"#7dcfff"
} else if $in < 52wk {
"#7aa2f7"
} else { "dark_gray" }
}
range: "#a9b1d6"
float: "#a9b1d6"
string: "#a9b1d6"
nothing: "#a9b1d6"
binary: "#a9b1d6"
cellpath: "#a9b1d6"
row_index: { fg: "#9ece6a" attr: "b" }
record: "#a9b1d6"
list: "#a9b1d6"
block: "#a9b1d6"
hints: "dark_gray"
search_result: { fg: "#f7768e" bg: "#a9b1d6" }
export def main [] {
return {
separator: "#a9b1d6"
leading_trailing_space_bg: { attr: "n" }
header: { fg: "#9ece6a" attr: "b" }
empty: "#7aa2f7"
bool: {|| if $in { "#7dcfff" } else { "light_gray" } }
int: "#a9b1d6"
filesize: {|e|
if $e == 0b {
"#a9b1d6"
} else if $e < 1mb {
"#7dcfff"
} else {{ fg: "#7aa2f7" }}
}
duration: "#a9b1d6"
date: {|| (date now) - $in |
if $in < 1hr {
{ fg: "#f7768e" attr: "b" }
} else if $in < 6hr {
"#f7768e"
} else if $in < 1day {
"#e0af68"
} else if $in < 3day {
"#9ece6a"
} else if $in < 1wk {
{ fg: "#9ece6a" attr: "b" }
} else if $in < 6wk {
"#7dcfff"
} else if $in < 52wk {
"#7aa2f7"
} else { "dark_gray" }
}
range: "#a9b1d6"
float: "#a9b1d6"
string: "#a9b1d6"
nothing: "#a9b1d6"
binary: "#a9b1d6"
cell-path: "#a9b1d6"
row_index: { fg: "#9ece6a" attr: "b" }
record: "#a9b1d6"
list: "#a9b1d6"
block: "#a9b1d6"
hints: "dark_gray"
search_result: { fg: "#f7768e" bg: "#a9b1d6" }
shape_and: { fg: "#bb9af7" attr: "b" }
shape_binary: { fg: "#bb9af7" attr: "b" }
shape_block: { fg: "#7aa2f7" attr: "b" }
shape_bool: "#7dcfff"
shape_custom: "#9ece6a"
shape_datetime: { fg: "#7dcfff" attr: "b" }
shape_directory: "#7dcfff"
shape_external: "#7dcfff"
shape_externalarg: { fg: "#9ece6a" attr: "b" }
shape_filepath: "#7dcfff"
shape_flag: { fg: "#7aa2f7" attr: "b" }
shape_float: { fg: "#bb9af7" attr: "b" }
shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" }
shape_globpattern: { fg: "#7dcfff" attr: "b" }
shape_int: { fg: "#bb9af7" attr: "b" }
shape_internalcall: { fg: "#7dcfff" attr: "b" }
shape_list: { fg: "#7dcfff" attr: "b" }
shape_literal: "#7aa2f7"
shape_match_pattern: "#9ece6a"
shape_matching_brackets: { attr: "u" }
shape_nothing: "#7dcfff"
shape_operator: "#e0af68"
shape_or: { fg: "#bb9af7" attr: "b" }
shape_pipe: { fg: "#bb9af7" attr: "b" }
shape_range: { fg: "#e0af68" attr: "b" }
shape_record: { fg: "#7dcfff" attr: "b" }
shape_redirection: { fg: "#bb9af7" attr: "b" }
shape_signature: { fg: "#9ece6a" attr: "b" }
shape_string: "#9ece6a"
shape_string_interpolation: { fg: "#7dcfff" attr: "b" }
shape_table: { fg: "#7aa2f7" attr: "b" }
shape_variable: "#bb9af7"
shape_and: { fg: "#bb9af7" attr: "b" }
shape_binary: { fg: "#bb9af7" attr: "b" }
shape_block: { fg: "#7aa2f7" attr: "b" }
shape_bool: "#7dcfff"
shape_custom: "#9ece6a"
shape_datetime: { fg: "#7dcfff" attr: "b" }
shape_directory: "#7dcfff"
shape_external: "#7dcfff"
shape_externalarg: { fg: "#9ece6a" attr: "b" }
shape_filepath: "#7dcfff"
shape_flag: { fg: "#7aa2f7" attr: "b" }
shape_float: { fg: "#bb9af7" attr: "b" }
shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" }
shape_globpattern: { fg: "#7dcfff" attr: "b" }
shape_int: { fg: "#bb9af7" attr: "b" }
shape_internalcall: { fg: "#7dcfff" attr: "b" }
shape_list: { fg: "#7dcfff" attr: "b" }
shape_literal: "#7aa2f7"
shape_match_pattern: "#9ece6a"
shape_matching_brackets: { attr: "u" }
shape_nothing: "#7dcfff"
shape_operator: "#e0af68"
shape_or: { fg: "#bb9af7" attr: "b" }
shape_pipe: { fg: "#bb9af7" attr: "b" }
shape_range: { fg: "#e0af68" attr: "b" }
shape_record: { fg: "#7dcfff" attr: "b" }
shape_redirection: { fg: "#bb9af7" attr: "b" }
shape_signature: { fg: "#9ece6a" attr: "b" }
shape_string: "#9ece6a"
shape_string_interpolation: { fg: "#7dcfff" attr: "b" }
shape_table: { fg: "#7aa2f7" attr: "b" }
shape_variable: "#bb9af7"
background: "#1a1b26"
foreground: "#c0caf5"
cursor: "#c0caf5"
}}
background: "#1a1b26"
foreground: "#c0caf5"
cursor: "#c0caf5"
}
}
# Update the Nushell configuration
export def --env "set color_config" [] {