Skip to content

Commit

Permalink
Set terminal colors as well
Browse files Browse the repository at this point in the history
  • Loading branch information
NotTheDr01ds committed Jul 17, 2024
1 parent 10f37a0 commit b32ab11
Show file tree
Hide file tree
Showing 903 changed files with 43,741 additions and 38,039 deletions.
41 changes: 33 additions & 8 deletions themes/make.nu
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,36 @@ let SOURCE = {
}
let THEMES = ($current_dir | path join "nu-themes")

def make-theme [name: string] {
def make_theme [ name: string ] {
$"
export-env {
use ./($name)_colors.nu
let theme = \(($name)_colors)
$env.config.color_config = $theme
# Set terminal colors
let osc_screen_foreground_color = '10;'
let osc_screen_background_color = '11;'
let osc_cursor_color = '12;'
print $\"
\(ansi -o $osc_screen_foreground_color)\($theme.foreground)\(char bel)
\(ansi -o $osc_screen_background_color)\($theme.background)\(char bel)
\(ansi -o $osc_cursor_color)\($theme.cursor)\(char bel)
\"
}
"
| str dedent
| save --force ({
parent: $THEMES
stem: $"($name)"
extension: "nu"
} | path join)

}
def make_theme_colors [name: string] {
let colors = (
open ($SOURCE.dir | path join $name)
| lines --skip-empty
Expand All @@ -22,11 +51,6 @@ def make-theme [name: string] {
)

(
"
export-env {
$env.config.color_config = \(main\)
}
" +
$'
export def main [] {
return {
Expand Down Expand Up @@ -117,7 +141,7 @@ def make-theme [name: string] {
| str dedent
| save --force ({
parent: $THEMES
stem: $name
stem: $"($name)_colors"
extension: "nu"
} | path join)
}
Expand All @@ -134,7 +158,8 @@ def main [] {
| each {|theme|
print $"Converting ($theme)"
try {
make-theme $theme
make_theme_colors $theme
make_theme $theme
} catch {
print -e $"Error converting ($theme)"
}
Expand Down
98 changes: 14 additions & 84 deletions themes/nu-themes/3024-day.nu
Original file line number Diff line number Diff line change
@@ -1,88 +1,18 @@

export-env {
$env.config.color_config = (main)
}

export def main [] {
return {
separator: "#a5a2a2"
leading_trailing_space_bg: { attr: "n" }
header: { fg: "#01a252" attr: "b" }
empty: "#01a0e4"
bool: {|| if $in { "#cdab53" } else { "light_gray" } }
int: "#a5a2a2"
filesize: {|e|
if $e == 0b {
"#a5a2a2"
} else if $e < 1mb {
"#b5e4f4"
} else {{ fg: "#01a0e4" }}
}
duration: "#a5a2a2"
date: {|| (date now) - $in |
if $in < 1hr {
{ fg: "#db2d20" attr: "b" }
} else if $in < 6hr {
"#db2d20"
} else if $in < 1day {
"#fded02"
} else if $in < 3day {
"#01a252"
} else if $in < 1wk {
{ fg: "#01a252" attr: "b" }
} else if $in < 6wk {
"#b5e4f4"
} else if $in < 52wk {
"#01a0e4"
} else { "dark_gray" }
}
range: "#a5a2a2"
float: "#a5a2a2"
string: "#a5a2a2"
nothing: "#a5a2a2"
binary: "#a5a2a2"
cellpath: "#a5a2a2"
row_index: { fg: "#01a252" attr: "b" }
record: "#a5a2a2"
list: "#a5a2a2"
block: "#a5a2a2"
hints: "dark_gray"
search_result: { fg: "#db2d20" bg: "#a5a2a2" }
use ./3024-day_colors.nu

shape_and: { fg: "#a16a94" attr: "b" }
shape_binary: { fg: "#a16a94" attr: "b" }
shape_block: { fg: "#01a0e4" attr: "b" }
shape_bool: "#cdab53"
shape_custom: "#01a252"
shape_datetime: { fg: "#b5e4f4" attr: "b" }
shape_directory: "#b5e4f4"
shape_external: "#b5e4f4"
shape_externalarg: { fg: "#01a252" attr: "b" }
shape_filepath: "#b5e4f4"
shape_flag: { fg: "#01a0e4" attr: "b" }
shape_float: { fg: "#a16a94" attr: "b" }
shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" }
shape_globpattern: { fg: "#b5e4f4" attr: "b" }
shape_int: { fg: "#a16a94" attr: "b" }
shape_internalcall: { fg: "#b5e4f4" attr: "b" }
shape_list: { fg: "#b5e4f4" attr: "b" }
shape_literal: "#01a0e4"
shape_match_pattern: "#01a252"
shape_matching_brackets: { attr: "u" }
shape_nothing: "#cdab53"
shape_operator: "#fded02"
shape_or: { fg: "#a16a94" attr: "b" }
shape_pipe: { fg: "#a16a94" attr: "b" }
shape_range: { fg: "#fded02" attr: "b" }
shape_record: { fg: "#b5e4f4" attr: "b" }
shape_redirection: { fg: "#a16a94" attr: "b" }
shape_signature: { fg: "#01a252" attr: "b" }
shape_string: "#01a252"
shape_string_interpolation: { fg: "#b5e4f4" attr: "b" }
shape_table: { fg: "#01a0e4" attr: "b" }
shape_variable: "#a16a94"
let theme = (3024-day_colors)
$env.config.color_config = $theme

background: "#f7f7f7"
foreground: "#4a4543"
cursor: "#4a4543"
}
# Set terminal colors
let osc_screen_foreground_color = '10;'
let osc_screen_background_color = '11;'
let osc_cursor_color = '12;'

print $"
(ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel)
(ansi -o $osc_screen_background_color)($theme.background)(char bel)
(ansi -o $osc_cursor_color)($theme.cursor)(char bel)
"
}
84 changes: 84 additions & 0 deletions themes/nu-themes/3024-day_colors.nu
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
export def main [] {
return {
separator: "#a5a2a2"
leading_trailing_space_bg: { attr: "n" }
header: { fg: "#01a252" attr: "b" }
empty: "#01a0e4"
bool: {|| if $in { "#cdab53" } else { "light_gray" } }
int: "#a5a2a2"
filesize: {|e|
if $e == 0b {
"#a5a2a2"
} else if $e < 1mb {
"#b5e4f4"
} else {{ fg: "#01a0e4" }}
}
duration: "#a5a2a2"
date: {|| (date now) - $in |
if $in < 1hr {
{ fg: "#db2d20" attr: "b" }
} else if $in < 6hr {
"#db2d20"
} else if $in < 1day {
"#fded02"
} else if $in < 3day {
"#01a252"
} else if $in < 1wk {
{ fg: "#01a252" attr: "b" }
} else if $in < 6wk {
"#b5e4f4"
} else if $in < 52wk {
"#01a0e4"
} else { "dark_gray" }
}
range: "#a5a2a2"
float: "#a5a2a2"
string: "#a5a2a2"
nothing: "#a5a2a2"
binary: "#a5a2a2"
cellpath: "#a5a2a2"
row_index: { fg: "#01a252" attr: "b" }
record: "#a5a2a2"
list: "#a5a2a2"
block: "#a5a2a2"
hints: "dark_gray"
search_result: { fg: "#db2d20" bg: "#a5a2a2" }

shape_and: { fg: "#a16a94" attr: "b" }
shape_binary: { fg: "#a16a94" attr: "b" }
shape_block: { fg: "#01a0e4" attr: "b" }
shape_bool: "#cdab53"
shape_custom: "#01a252"
shape_datetime: { fg: "#b5e4f4" attr: "b" }
shape_directory: "#b5e4f4"
shape_external: "#b5e4f4"
shape_externalarg: { fg: "#01a252" attr: "b" }
shape_filepath: "#b5e4f4"
shape_flag: { fg: "#01a0e4" attr: "b" }
shape_float: { fg: "#a16a94" attr: "b" }
shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" }
shape_globpattern: { fg: "#b5e4f4" attr: "b" }
shape_int: { fg: "#a16a94" attr: "b" }
shape_internalcall: { fg: "#b5e4f4" attr: "b" }
shape_list: { fg: "#b5e4f4" attr: "b" }
shape_literal: "#01a0e4"
shape_match_pattern: "#01a252"
shape_matching_brackets: { attr: "u" }
shape_nothing: "#cdab53"
shape_operator: "#fded02"
shape_or: { fg: "#a16a94" attr: "b" }
shape_pipe: { fg: "#a16a94" attr: "b" }
shape_range: { fg: "#fded02" attr: "b" }
shape_record: { fg: "#b5e4f4" attr: "b" }
shape_redirection: { fg: "#a16a94" attr: "b" }
shape_signature: { fg: "#01a252" attr: "b" }
shape_string: "#01a252"
shape_string_interpolation: { fg: "#b5e4f4" attr: "b" }
shape_table: { fg: "#01a0e4" attr: "b" }
shape_variable: "#a16a94"

background: "#f7f7f7"
foreground: "#4a4543"
cursor: "#4a4543"
}
}
98 changes: 14 additions & 84 deletions themes/nu-themes/3024-night.nu
Original file line number Diff line number Diff line change
@@ -1,88 +1,18 @@

export-env {
$env.config.color_config = (main)
}

export def main [] {
return {
separator: "#a5a2a2"
leading_trailing_space_bg: { attr: "n" }
header: { fg: "#01a252" attr: "b" }
empty: "#01a0e4"
bool: {|| if $in { "#cdab53" } else { "light_gray" } }
int: "#a5a2a2"
filesize: {|e|
if $e == 0b {
"#a5a2a2"
} else if $e < 1mb {
"#b5e4f4"
} else {{ fg: "#01a0e4" }}
}
duration: "#a5a2a2"
date: {|| (date now) - $in |
if $in < 1hr {
{ fg: "#db2d20" attr: "b" }
} else if $in < 6hr {
"#db2d20"
} else if $in < 1day {
"#fded02"
} else if $in < 3day {
"#01a252"
} else if $in < 1wk {
{ fg: "#01a252" attr: "b" }
} else if $in < 6wk {
"#b5e4f4"
} else if $in < 52wk {
"#01a0e4"
} else { "dark_gray" }
}
range: "#a5a2a2"
float: "#a5a2a2"
string: "#a5a2a2"
nothing: "#a5a2a2"
binary: "#a5a2a2"
cellpath: "#a5a2a2"
row_index: { fg: "#01a252" attr: "b" }
record: "#a5a2a2"
list: "#a5a2a2"
block: "#a5a2a2"
hints: "dark_gray"
search_result: { fg: "#db2d20" bg: "#a5a2a2" }
use ./3024-night_colors.nu

shape_and: { fg: "#a16a94" attr: "b" }
shape_binary: { fg: "#a16a94" attr: "b" }
shape_block: { fg: "#01a0e4" attr: "b" }
shape_bool: "#cdab53"
shape_custom: "#01a252"
shape_datetime: { fg: "#b5e4f4" attr: "b" }
shape_directory: "#b5e4f4"
shape_external: "#b5e4f4"
shape_externalarg: { fg: "#01a252" attr: "b" }
shape_filepath: "#b5e4f4"
shape_flag: { fg: "#01a0e4" attr: "b" }
shape_float: { fg: "#a16a94" attr: "b" }
shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: "b" }
shape_globpattern: { fg: "#b5e4f4" attr: "b" }
shape_int: { fg: "#a16a94" attr: "b" }
shape_internalcall: { fg: "#b5e4f4" attr: "b" }
shape_list: { fg: "#b5e4f4" attr: "b" }
shape_literal: "#01a0e4"
shape_match_pattern: "#01a252"
shape_matching_brackets: { attr: "u" }
shape_nothing: "#cdab53"
shape_operator: "#fded02"
shape_or: { fg: "#a16a94" attr: "b" }
shape_pipe: { fg: "#a16a94" attr: "b" }
shape_range: { fg: "#fded02" attr: "b" }
shape_record: { fg: "#b5e4f4" attr: "b" }
shape_redirection: { fg: "#a16a94" attr: "b" }
shape_signature: { fg: "#01a252" attr: "b" }
shape_string: "#01a252"
shape_string_interpolation: { fg: "#b5e4f4" attr: "b" }
shape_table: { fg: "#01a0e4" attr: "b" }
shape_variable: "#a16a94"
let theme = (3024-night_colors)
$env.config.color_config = $theme

background: "#090300"
foreground: "#a5a2a2"
cursor: "#a5a2a2"
}
# Set terminal colors
let osc_screen_foreground_color = '10;'
let osc_screen_background_color = '11;'
let osc_cursor_color = '12;'

print $"
(ansi -o $osc_screen_foreground_color)($theme.foreground)(char bel)
(ansi -o $osc_screen_background_color)($theme.background)(char bel)
(ansi -o $osc_cursor_color)($theme.cursor)(char bel)
"
}
Loading

0 comments on commit b32ab11

Please sign in to comment.