Merge remote-tracking branch 'upstream/master' into primary

This commit is contained in:
Mattias Eriksson 2024-03-04 07:56:36 +01:00
commit 63503d53bd
47 changed files with 3639 additions and 1073 deletions

1683
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -1,31 +1,37 @@
[package]
name = "cosmic-term"
version = "0.1.0"
authors = ["Jeremy Soller <jeremy@system76.com>"]
edition = "2021"
license = "GPL-3.0-only"
rust-version = "1.71"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[build-dependencies]
vergen = { version = "8", features = ["git", "gitcl"] }
[dependencies]
alacritty_terminal = "0.20"
env_logger = "0.10"
lazy_static = "1"
hex_color = { version = "3", features = ["serde"] }
indexmap = "2"
lazy_static = "1"
lexical-sort = "0.3.1"
log = "0.4"
open = "5.0.2"
palette = { version = "0.7", features = ["serde"] }
paste = "1.0"
ron = "0.8"
serde = { version = "1", features = ["serde_derive"] }
shlex = "1"
tokio = { version = "1", features = ["sync"] }
# Internationalization
i18n-embed = { version = "0.13", features = ["fluent-system", "desktop-requester"] }
i18n-embed-fl = "0.6"
rust-embed = "6"
paste = "1.0"
palette = "0.7"
i18n-embed = { version = "0.14", features = ["fluent-system", "desktop-requester"] }
i18n-embed-fl = "0.7"
rust-embed = "8"
[dependencies.smol_str]
version = "0.2.1"
features = ["serde"]
[dependencies.cosmic-files]
git = "https://github.com/pop-os/cosmic-files.git"
default-features = false
[dependencies.cosmic-text]
git = "https://github.com/pop-os/cosmic-text.git"
@ -34,19 +40,23 @@ features = ["shape-run-cache"]
[dependencies.libcosmic]
git = "https://github.com/pop-os/libcosmic.git"
default-features = false
features = ["tokio", "winit"]
features = ["multi-window", "tokio", "winit"]
[features]
default = ["wgpu"]
wgpu = ["libcosmic/wgpu"]
[dependencies.smol_str]
version = "0.2.1"
features = ["serde"]
[patch.crates-io]
# https://github.com/rust-lang/libc/pull/3512
libc = { git = "https://gitlab.redox-os.org/redox-os/liblibc.git", branch = "redox_0.2.151" }
[target.'cfg(unix)'.dependencies]
fork = "0.1"
[features]
default = ["wgpu"]
wgpu = ["libcosmic/wgpu", "cosmic-files/wgpu"]
[profile.release-with-debug]
inherits = "release"
debug = true
[target.'cfg(unix)'.dependencies]
fork = "0.1"

View file

@ -4,3 +4,8 @@ WIP COSMIC terminal emulator, built using [alacritty\_terminal](https://docs.rs/
The `wgpu` feature, enabled by default, supports GPU rendering using `glyphon`
and `wgpu`. If `wgpu` is not enabled or fails to initialize, then rendering falls
back to using `softbuffer` and `tiny-skia`.
## Color Schemes
Custom color schemes can be imported from the `View -> Color schemes...` menu item.
You can find templates for color schemes in the [color-schemes](color-schemes) folder.

17
build.rs Normal file
View file

@ -0,0 +1,17 @@
fn main() -> Result<(), Box<dyn std::error::Error>> {
// Rebuild if i18n files change
println!("cargo:rerun-if-changed=i18n");
// Emit version information (if not cached by just vendor)
let mut vergen = vergen::EmitBuilder::builder();
println!("cargo:rerun-if-env-changed=VERGEN_GIT_COMMIT_DATE");
if std::env::var_os("VERGEN_GIT_COMMIT_DATE").is_none() {
vergen.git_commit_date();
}
println!("cargo:rerun-if-env-changed=VERGEN_GIT_SHA");
if std::env::var_os("VERGEN_GIT_SHA").is_none() {
vergen.git_sha(false);
}
vergen.fail_on_error().emit()?;
Ok(())
}

View file

@ -0,0 +1,37 @@
(
name: "COSMIC Dark",
foreground: "#C4C4C4",
cursor: "#C4C4C4",
bright_foreground: "#C4C4C4",
dim_foreground: "#8E8E8E",
normal: (
black: "#1B1B1B",
red: "#F16161",
green: "#7CB987",
yellow: "#DDC74C",
blue: "#6296BE",
magenta: "#BE6DEE",
cyan: "#49BAC8",
white: "#BEBEBE",
),
bright: (
black: "#808080",
red: "#FF8985",
green: "#97D5A0",
yellow: "#FAE365",
blue: "#7DB1DA",
magenta: "#D68EFF",
cyan: "#49BAC8",
white: "#C4C4C4",
),
dim: (
black: "#000000",
red: "#A04040",
green: "#5D7D62",
yellow: "#9E914A",
blue: "#486073",
magenta: "#7F46A1",
cyan: "#3F7F87",
white: "#898989",
),
)

View file

@ -0,0 +1,37 @@
(
name: "COSMIC Light",
foreground: "#292929",
cursor: "#292929",
bright_foreground: "#808080",
dim_foreground: "#181818",
normal: (
black: "#292929",
red: "#8C151F",
green: "#145129",
yellow: "#624000",
blue: "#003F5F",
magenta: "#6D169C",
cyan: "#004F57",
white: "#BEBEBE",
),
bright: (
black: "#808080",
red: "#9D2329",
green: "#235D34",
yellow: "#714B00",
blue: "#054B6F",
magenta: "#7A28A9",
cyan: "#005C5D",
white: "#D7D7D7",
),
dim: (
black: "#181818",
red: "#652020",
green: "#183C22",
yellow: "#4A320A",
blue: "#072D44",
magenta: "#50256D",
cyan: "#0B3C41",
white: "#ABABAB",
),
)

View file

@ -0,0 +1,38 @@
(
name: "Linux Console",
foreground: "#FFFFFF",
background: "#000000",
cursor: "#FFFFFF",
bright_foreground: "#AAAAAA",
dim_foreground: "#E2E2E2",
normal: (
black: "#000000",
red: "#AA0000",
green: "#00AA00",
yellow: "#AA5500",
blue: "#0000AA",
magenta: "#AA00AA",
cyan: "#00AAAA",
white: "#AAAAAA",
),
bright: (
black: "#555555",
red: "#FF5555",
green: "#55FF55",
yellow: "#FFFF55",
blue: "#5555FF",
magenta: "#FF55FF",
cyan: "#55FFFF",
white: "#FFFFFF",
),
dim: (
black: "#000000",
red: "#70221A",
green: "#458340",
yellow: "#814514",
blue: "#0A1B44",
magenta: "#7E1B7E",
cyan: "#278B8B",
white: "#8F8F8F",
),
)

View file

@ -0,0 +1,38 @@
(
name: "OneHalfDark",
foreground: "#DCDFE4",
background: "#282C34",
cursor: "#FBFBFC",
bright_foreground: "#FBFBFC",
dim_foreground: "#A8A8A8",
normal: (
black: "#282C34",
red: "#E06C75",
green: "#98C379",
yellow: "#E5C07B",
blue: "#61AFEF",
magenta: "#C678DD",
cyan: "#56B6C2",
white: "#DCDFE4",
),
bright: (
black: "#5D677A",
red: "#EE9397",
green: "#B6DE9B",
yellow: "#F4DFB8",
blue: "#94C9F8",
magenta: "#D89EE9",
cyan: "#74D2DE",
white: "#FBFBFC",
),
dim: (
black: "#000000",
red: "#904A4F",
green: "#6F885F",
yellow: "#A68C5D",
blue: "#3E79A8",
magenta: "#855194",
cyan: "#467B82",
white: "#A8A8A8",
),
)

View file

@ -0,0 +1,38 @@
(
name: "Pop Dark",
foreground: "#F2F2F2",
background: "#333333",
cursor: "#EEEEEC",
bright_foreground: "#EEEEEC",
dim_foreground: "#E4E4E4",
normal: (
black: "#333333",
red: "#CC0000",
green: "#4E9A06",
yellow: "#C4A000",
blue: "#3465A4",
magenta: "#75507B",
cyan: "#06989A",
white: "#D3D7CF",
),
bright: (
black: "#88807C",
red: "#F15D22",
green: "#73C48F",
yellow: "#FFCE51",
blue: "#48B9C7",
magenta: "#AD7FA8",
cyan: "#34E2E2",
white: "#EEEEEC",
),
dim: (
black: "#272727",
red: "#A1362B",
green: "#558737",
yellow: "#B1942D",
blue: "#3B5981",
magenta: "#5D4D5F",
cyan: "#288889",
white: "#C7C7C7",
),
)

View file

@ -0,0 +1,38 @@
(
name: "Rxvt Dark",
foreground: "#FFFFFF",
background: "#000000",
cursor: "#FFFFFF",
bright_foreground: "#FAEBD7",
dim_foreground: "#DDDDDD",
normal: (
black: "#000000",
red: "#CD0000",
green: "#00CD00",
yellow: "#CDCD00",
blue: "#0000CD",
magenta: "#CD00CD",
cyan: "#00CDCD",
white: "#FAEBD7",
),
bright: (
black: "#404040",
red: "#FF0000",
green: "#00FF00",
yellow: "#FFFF00",
blue: "#0000FF",
magenta: "#FF00FF",
cyan: "#00FFFF",
white: "#FFFFFF",
),
dim: (
black: "#000000",
red: "#872B22",
green: "#549E4E",
yellow: "#AAAB34",
blue: "#0F2353",
magenta: "#972596",
cyan: "#31A7A6",
white: "#E3C7A1",
),
)

View file

@ -0,0 +1,38 @@
(
name: "Rxvt Light",
foreground: "#000000",
background: "#FFFFFF",
cursor: "#000000",
bright_foreground: "#404040",
dim_foreground: "#000000",
normal: (
black: "#000000",
red: "#CD0000",
green: "#00CD00",
yellow: "#CDCD00",
blue: "#0000CD",
magenta: "#CD00CD",
cyan: "#00CDCD",
white: "#FAEBD7",
),
bright: (
black: "#404040",
red: "#FF0000",
green: "#00FF00",
yellow: "#FFFF00",
blue: "#0000FF",
magenta: "#FF00FF",
cyan: "#00FFFF",
white: "#FFFFFF",
),
dim: (
black: "#000000",
red: "#691F18",
green: "#468742",
yellow: "#94952C",
blue: "#051130",
magenta: "#7A1A7A",
cyan: "#288F8F",
white: "#D2B081",
),
)

View file

@ -0,0 +1,37 @@
(
name: "Selenized Black",
foreground: "#B9B9B9",
background: "#181818",
cursor: "#777777",
dim_foreground: "#848484",
normal: (
black: "#252525",
red: "#ED4A46",
green: "#70B433",
yellow: "#DBB32D",
blue: "#368AEB",
magenta: "#EB6EB7",
cyan: "#3FC5B7",
white: "#777777",
),
bright: (
black: "#3B3B3B",
red: "#FF5E56",
green: "#83C746",
yellow: "#EFC541",
blue: "#4F9CFE",
magenta: "#FF81CA",
cyan: "#56D8C9",
white: "#DEDEDE",
),
dim: (
black: "#000000",
red: "#923833",
green: "#527736",
yellow: "#988038",
blue: "#285892",
magenta: "#A2497D",
cyan: "#3E877F",
white: "#464646",
),
)

View file

@ -0,0 +1,37 @@
(
name: "Selenized Dark",
foreground: "#ADBCBC",
background: "#103C48",
cursor: "#72898F",
dim_foreground: "#838383",
normal: (
black: "#184956",
red: "#FA5750",
green: "#75B938",
yellow: "#DBB32D",
blue: "#4695F7",
magenta: "#F275BE",
cyan: "#41C7B9",
white: "#72898F",
),
bright: (
black: "#2D5B69",
red: "#FF665C",
green: "#84C747",
yellow: "#EBC13D",
blue: "#58A3FF",
magenta: "#FF84CD",
cyan: "#53D6C7",
white: "#CAD8D9",
),
dim: (
black: "#061519",
red: "#A63A35",
green: "#567C39",
yellow: "#988038",
blue: "#2B62A6",
magenta: "#AF4885",
cyan: "#3F8981",
white: "#525252",
),
)

View file

@ -0,0 +1,37 @@
(
name: "Selenized Light",
foreground: "#53676D",
background: "#FBF3DB",
cursor: "#ECE3CC",
dim_foreground: "#333333",
normal: (
black: "#ECE3CC",
red: "#D2212D",
green: "#489100",
yellow: "#AD8900",
blue: "#0072D4",
magenta: "#CA4898",
cyan: "#009C8F",
white: "#909995",
),
bright: (
black: "#D5CDB6",
red: "#CC1729",
green: "#428B00",
yellow: "#A78300",
blue: "#006DCE",
magenta: "#C44392",
cyan: "#00978A",
white: "#3A4D53",
),
dim: (
black: "#B5AC95",
red: "#722423",
green: "#335520",
yellow: "#6E5917",
blue: "#124276",
magenta: "#75365B",
cyan: "#1A6159",
white: "#636363",
),
)

View file

@ -0,0 +1,37 @@
(
name: "Selenized White",
foreground: "#474747",
background: "#FFFFFF",
cursor: "#EBEBEB",
dim_foreground: "#181818",
normal: (
black: "#EBEBEB",
red: "#D6000C",
green: "#1D9700",
yellow: "#C49700",
blue: "#0064E4",
magenta: "#DD0F9D",
cyan: "#00AD9C",
white: "#878787",
),
bright: (
black: "#CDCDCD",
red: "#BF0000",
green: "#008400",
yellow: "#AF8500",
blue: "#0054CF",
magenta: "#C7008B",
cyan: "#009A8A",
white: "#282828",
),
dim: (
black: "#B3B3B3",
red: "#71221B",
green: "#2D5727",
yellow: "#82661D",
blue: "#153B75",
magenta: "#841D5F",
cyan: "#207166",
white: "#555555",
),
)

View file

@ -0,0 +1,38 @@
(
name: "Solarized Dark",
foreground: "#839496",
background: "#002B36",
cursor: "#839496",
bright_foreground: "#268BD2",
dim_foreground: "#5D5D5D",
normal: (
black: "#073642",
red: "#DC322F",
green: "#859900",
yellow: "#B58900",
blue: "#268BD2",
magenta: "#D33682",
cyan: "#2AA198",
white: "#EEE8D5",
),
bright: (
black: "#002B36",
red: "#CB4B16",
green: "#586E75",
yellow: "#657B83",
blue: "#839496",
magenta: "#6C71C4",
cyan: "#93A1A1",
white: "#FDF6E3",
),
dim: (
black: "#000000",
red: "#7D2C26",
green: "#56621A",
yellow: "#745918",
blue: "#23577E",
magenta: "#792E4E",
cyan: "#296661",
white: "#B7B09C",
),
)

View file

@ -0,0 +1,38 @@
(
name: "Solarized Light",
foreground: "#657B83",
background: "#FDF6E3",
cursor: "#657B83",
bright_foreground: "#B58900",
dim_foreground: "#454545",
normal: (
black: "#073642",
red: "#DC322F",
green: "#859900",
yellow: "#B58900",
blue: "#268BD2",
magenta: "#D33682",
cyan: "#2AA198",
white: "#EEE8D5",
),
bright: (
black: "#002B36",
red: "#CB4B16",
green: "#586E75",
yellow: "#657B83",
blue: "#839496",
magenta: "#6C71C4",
cyan: "#93A1A1",
white: "#FDF6E3",
),
dim: (
black: "#000000",
red: "#7D2C26",
green: "#56621A",
yellow: "#745918",
blue: "#23577E",
magenta: "#792E4E",
cyan: "#296661",
white: "#B7B09C",
),
)

View file

@ -0,0 +1,38 @@
(
name: "Tango Dark",
foreground: "#D3D7CF",
background: "#2E3436",
cursor: "#D3D7CF",
bright_foreground: "#EEEEEC",
dim_foreground: "#BABABA",
normal: (
black: "#2E3436",
red: "#CC0000",
green: "#4E9A06",
yellow: "#C4A000",
blue: "#3465A4",
magenta: "#75507B",
cyan: "#06989A",
white: "#D3D7CF",
),
bright: (
black: "#555753",
red: "#EF2929",
green: "#8AE234",
yellow: "#FCE94F",
blue: "#729FCF",
magenta: "#AD7FA8",
cyan: "#34E2E2",
white: "#EEEEEC",
),
dim: (
black: "#1B1B1B",
red: "#8E2E24",
green: "#4B7930",
yellow: "#A28728",
blue: "#324D71",
magenta: "#504252",
cyan: "#237A7B",
white: "#BABABA",
),
)

View file

@ -0,0 +1,38 @@
(
name: "Tango Light",
foreground: "#2E3436",
background: "#EEEEEC",
cursor: "#2E3436",
bright_foreground: "#555753",
dim_foreground: "#010101",
normal: (
black: "#2E3436",
red: "#CC0000",
green: "#4E9A06",
yellow: "#C4A000",
blue: "#3465A4",
magenta: "#75507B",
cyan: "#06989A",
white: "#D3D7CF",
),
bright: (
black: "#555753",
red: "#EF2929",
green: "#8AE234",
yellow: "#FCE94F",
blue: "#729FCF",
magenta: "#AD7FA8",
cyan: "#34E2E2",
white: "#EEEEEC",
),
dim: (
black: "#010101",
red: "#681F18",
green: "#395D24",
yellow: "#846E1F",
blue: "#213550",
magenta: "#362C37",
cyan: "#195E5F",
white: "#9F9F9F",
),
)

View file

@ -0,0 +1,38 @@
(
name: "XTerm Dark",
foreground: "#FFFFFF",
background: "#000000",
cursor: "#FFFFFF",
bright_foreground: "#E5E5E5",
dim_foreground: "#DDDDDD",
normal: (
black: "#000000",
red: "#CD0000",
green: "#00CD00",
yellow: "#CDCD00",
blue: "#0000EE",
magenta: "#CD00CD",
cyan: "#00CDCD",
white: "#E5E5E5",
),
bright: (
black: "#7F7F7F",
red: "#FF0000",
green: "#00FF00",
yellow: "#FFFF00",
blue: "#5C5CFF",
magenta: "#FF00FF",
cyan: "#00FFFF",
white: "#FFFFFF",
),
dim: (
black: "#000000",
red: "#872B22",
green: "#549E4E",
yellow: "#AAAB34",
blue: "#152E69",
magenta: "#972596",
cyan: "#31A7A6",
white: "#C3C3C3",
),
)

View file

@ -0,0 +1,38 @@
(
name: "XTerm Light",
foreground: "#000000",
background: "#FFFFFF",
cursor: "#000000",
bright_foreground: "#7F7F7F",
dim_foreground: "#000000",
normal: (
black: "#000000",
red: "#CD0000",
green: "#00CD00",
yellow: "#CDCD00",
blue: "#0000EE",
magenta: "#CD00CD",
cyan: "#00CDCD",
white: "#E5E5E5",
),
bright: (
black: "#7F7F7F",
red: "#FF0000",
green: "#00FF00",
yellow: "#FFFF00",
blue: "#5C5CFF",
magenta: "#FF00FF",
cyan: "#00FFFF",
white: "#FFFFFF",
),
dim: (
black: "#000000",
red: "#691F18",
green: "#468742",
yellow: "#94952C",
blue: "#0B1D47",
magenta: "#7A1A7A",
cyan: "#288F8F",
white: "#AEAEAE",
),
)

View file

@ -0,0 +1,38 @@
(
name: "gruvbox-dark",
foreground: "#EBDBB2",
background: "#282828",
cursor: "#EBDBB2",
bright_foreground: "#EBDBB2",
dim_foreground: "#C0B28D",
normal: (
black: "#282828",
red: "#CC241D",
green: "#98971A",
yellow: "#D79921",
blue: "#458588",
magenta: "#B16286",
cyan: "#689D6A",
white: "#A89984",
),
bright: (
black: "#928374",
red: "#FB4934",
green: "#B8BB26",
yellow: "#FABD2F",
blue: "#83A598",
magenta: "#D3869B",
cyan: "#8EC07C",
white: "#EBDBB2",
),
dim: (
black: "#020202",
red: "#7F2C24",
green: "#6F6F29",
yellow: "#A07732",
blue: "#3A5A5C",
magenta: "#724D5D",
cyan: "#547055",
white: "#747474",
),
)

2
debian/control vendored
View file

@ -14,4 +14,4 @@ Package: cosmic-term
Architecture: amd64 arm64
Depends: ${misc:Depends}, ${shlibs:Depends}
Provides: x-terminal-emulator
Description: Cosmic Terminal
Description: COSMIC Terminal

6
debian/rules vendored
View file

@ -8,11 +8,7 @@ export VENDOR ?= 1
override_dh_auto_clean:
if ! ischroot && test "${VENDOR}" = "1"; then \
mkdir -p .cargo; \
cargo vendor | head -n -1 > .cargo/config; \
echo 'directory = "vendor"' >> .cargo/config; \
tar pcf vendor.tar vendor; \
rm -rf vendor; \
just vendor; \
fi
override_dh_auto_build:

View file

@ -1,7 +1,19 @@
cosmic-terminal = COSMIC Terminal
new-terminal = New terminal
# Context Pages
## About
git-description = Git commit {$hash} on {$date}
## Color schemes
color-schemes = Color schemes
rename = Rename
export = Export
delete = Delete
import = Import
import-errors = Import errors
## Profiles
profiles = Profiles
name = Name
@ -10,6 +22,7 @@ tab-title = Tab title
tab-title-description = Override the default tab title
add-profile = Add profile
new-profile = New profile
make-default = Make default
## Settings
settings = Settings
@ -27,7 +40,7 @@ opacity = Background opacity
### Font
font = Font
advanced-font-settings = Advanced Font Settings
advanced-font-settings = Advanced font settings
default-font = Font
default-font-size = Font size
default-font-stretch = Font stretch
@ -78,4 +91,6 @@ previous-tab = Previous tab
split-horizontal = Split horizontal
split-vertical = Split vertical
pane-toggle-maximize = Toggle maximized
menu-color-schemes = Color schemes...
menu-settings = Settings...
menu-about = About COSMIC Terminal...

96
i18n/it/cosmic_term.ftl Normal file
View file

@ -0,0 +1,96 @@
cosmic-terminal = Terminale COSMIC
new-terminal = Nuovo terminale
# Context Pages
## About
git-description = Commit git {$hash} del {$date}
## Color schemes
color-schemes = Schema colori
rename = Rinomina
export = Esporta
delete = Cancella
import = Importa
import-errors = Importa errori
## Profiles
profiles = Profili
name = Nome
command-line = Riga di comando
tab-title = Titolo scheda
tab-title-description = Sovrascrivi il titolo predefinito della scheda
add-profile = Aggiungi profilo
new-profile = Nuovo profilo
make-default = Rendi predefinito
## Settings
settings = Impostazioni
### Appearance
appearance = Aspetto
theme = Tema
match-desktop = Abbina alla scrivania
dark = Scuro
light = Chiaro
syntax-dark = Schema colori scuro
syntax-light = Schema colori chiaro
default-zoom-step = Passi ingrandimento
opacity = Opacità sfondo
### Font
font = Carattere tipografico
advanced-font-settings = Impostazioni avanzate del carattere tipografico
default-font = Font predefinito
default-font-size = Dimensione del carattere tipografico predefinita
default-font-stretch = Estensione del carattere tipografico predefinita
default-font-weight = Spessore del carattere tipografico normale
default-dim-font-weight = Spessore del carattere tipografico attenuato
default-bold-font-weight = Spessore del carattere tipografico in grassetto
use-bright-bold = Rendi il testo in grassetto più luminoso
### Splits
splits = Suddivisioni
focus-follow-mouse = Il focus di scrittura segue il mouse
### Advanced
advanced = Avanzate
show-headerbar = Mostra intestazione
show-header-description = Mostra intestazione dal menu click destro.
# Find
find-placeholder = Trova...
find-previous = Trova precendente
find-next = Trova successivo
# Menu
## File
file = File
new-tab = Nuova scheda
new-window = Nuova finestra
profile = Profilo
menu-profiles = Profili...
close-tab = Chiudi finestra
quit = Esci
## Edit
edit = Modifica
copy = Copia
paste = Incolla
select-all = Seleziona tutti
find = Trova
## View
view = Visualizza
zoom-in = Ingrandisci testo
zoom-reset = Dimensioni testo predefinite
zoom-out = Rimpicciolisci testo
next-tab = Scheda successiva
previous-tab = Scheda precedente
split-horizontal = Dividi orizzontalmente
split-vertical = Dividi verticalmente
pane-toggle-maximize = Abilita/disabilita schermo intero
menu-color-schemes = Schemi di colore...
menu-settings = Impostazioni...
menu-about = A proposito di COSMIC Terminal...

View file

@ -0,0 +1,96 @@
cosmic-terminal = COSMIC Terminal
new-terminal = Novo terminal
# Context Pages
## About
git-description = Commit do git {$hash} em {$date}
## Color schemes
color-schemes = Esquemas de cores
rename = Renomear
export = Exportar
delete = Deletar
import = Importar
import-errors = Erros de Importação
## Profiles
profiles = Perfis
name = Nome
command-line = Linha de comando
tab-title = Título da aba
tab-title-description = Sobrescrever o título da aba padrão
add-profile = Adicionar perfil
new-profile = Novo perfil
make-default = Tornar padrão
## Settings
settings = Configurações
### Appearance
appearance = Aparência
theme = Tema
match-desktop = Acompanhar o tema do desktop
dark = Escuro
light = Claro
syntax-dark = Esquema de cores escuro
syntax-light = Esquema de cores claro
default-zoom-step = Incrementos de zoom
opacity = Opacidade do fundo
### Font
font = Fonte
advanced-font-settings = Configurações avançadas de fonte
default-font = Fonte
default-font-size = Tamanho da fonte
default-font-stretch = Esticamento da fonte
default-font-weight = Peso padrão da fonte
default-dim-font-weight = Peso da fonte clareara
default-bold-font-weight = Peso da fonte em negrito
use-bright-bold = Usar negrito brilhante
### Splits
splits = Divisões
focus-follow-mouse = Foco de digitação segue o mouse
### Advanced
advanced = Avançado
show-headerbar = Mostrar barra de título
show-header-description = Mostrar a barra de título na janela no menu do botão direito
# Find
find-placeholder = Pesquisar...
find-previous = Pesquisar anterior
find-next = Pesquisar próximo
# Menu
## File
file = Arquivo
new-tab = Nova aba
new-window = Nova janela
profile = Perfil
menu-profiles = Perfis...
close-tab = Fechar aba
quit = Sair
## Edit
edit = Editar
copy = Copiar
paste = Colar
select-all = Selecione tudo
find = Pesquisar
## View
view = Visualizar
zoom-in = Aumentar texto
zoom-reset = Redefinir zoom
zoom-out = Diminuir texto
next-tab = Próxima aba
previous-tab = Aba anterior
split-horizontal = Dividir horizontalmente
split-vertical = Dividir verticalmente
pane-toggle-maximize = Alternar maximização
menu-color-schemes = Esquemas de cores...
menu-settings = Configurações...
menu-about = Sobre COSMIC Terminal...

View file

@ -1,5 +1,30 @@
cosmic-terminal = COSMIC Терминал
new-terminal = Нови терминал
# Context Pages
## About
about = О програму
git-description = Git commit {$hash} on {$date}
## Color schemes
color-schemes = Шеме боја
rename = Преименуј
export = Извези
delete = Избриши
import = Увези
import-errors = Грешке при увозу
## Profiles
profiles = Профили
name = Име
command-line = Командна линија
tab-title = Наслов картице
tab-title-description = Замени подразумевани наслов картице
add-profile = Додај профил
new-profile = Нови профил
make-default = Постави као подразумевани
## Settings
settings = Подешавања
@ -9,15 +34,35 @@ theme = Тема
match-desktop = Као систем
dark = Тамна
light = Светла
syntax-dark = Тамна синтакса
syntax-light = Светла синтакса
advanced-font-settings = Напредна подешавања фонта
default-font = Подразумевани фонт
default-font-stretch = Подразумевано растезање фонта
default-font-weight = Подразумевана дебљина фонта
default-bold-font-weight = Подразумевана дебљина подебљаног фонта
default-font-size = Подразумевана величина фонта
syntax-dark = Тамна тема синтаксе
syntax-light = Светла тема синтаксе
default-zoom-step = Подразумевани корак увећања
opacity = Непрозирност позадине
### Font
font = Фонт
advanced-font-settings = Напредна подешавања фонта
default-font = Фонт
default-font-size = Величина фонта
default-font-stretch = Растезање фонта
default-font-weight = Дебљина нормалног фонта
default-dim-font-weight = Дебљина тамног фонта
default-bold-font-weight = Дебљина подебљаног фонта
use-bright-bold = Учини подебљани текст светлијим
### Splits
splits = Поделе
focus-follow-mouse = Фокус куцања прати миш
### Advanced
advanced = Напредно
show-headerbar = Прикажи заглавље
show-header-description = Откријте заглавље из менија десног клика.
# Find
find-placeholder = Пронађи...
find-previous = Пронађи претходно
find-next = Пронађи следеће
# Menu
@ -25,6 +70,8 @@ default-zoom-step = Подразумевани корак увећања
file = Датотека
new-tab = Нова картица
new-window = Нови прозор
profile = Профили
menu-profiles = Профили...
close-tab = Затвори картицу
quit = Изађи
@ -37,7 +84,14 @@ find = Пронађи
## View
view = Приказ
zoom-in = Већи текст
zoom-reset = Подразумевана величина текста
zoom-out = Мањи текст
next-tab = Следећа картица
previous-tab = Претходна картица
split-horizontal = Подели хоризонтално
split-vertical = Подели вертикално
pane-toggle-maximize = Максимизуј
menu-color-schemes = Шеме боја...
menu-settings = Подешавања...
# Context menu
show-headerbar = Прикажи траку заглавља
menu-about = О COSMIC Терминалу...

View file

@ -1,5 +1,30 @@
cosmic-terminal = COSMIC Terminal
new-terminal = Novi terminal
# Context Pages
## About
about = O programu
git-description = Git commit {$hash} on {$date}
## Color schemes
color-schemes = Šeme boja
rename = Preimenuj
export = Izvezi
delete = Izbriši
import = Uvezi
import-errors = Greške pri uvozu
## Profiles
profiles = Profili
name = Ime
command-line = Komandna linija
tab-title = Naslov kartice
tab-title-description = Zameni podrazumevani naslov kartice
add-profile = Dodaj profil
new-profile = Novi profil
make-default = Postavi kao podrazumevani
## Settings
settings = Podešavanja
@ -9,15 +34,35 @@ theme = Tema
match-desktop = Kao sistem
dark = Tamna
light = Svetla
syntax-dark = Tamna sintaksa
syntax-light = Svetla sintaksa
advanced-font-settings = Napredna podešavanja fonta
default-font = Podrazumevani font
default-font-stretch = Podrazumevano rastezanje fonta
default-font-weight = Podrazumevana debljina fonta
default-bold-font-weight = Podrazumevana debljina podebljanog fonta
default-font-size = Podrazumevana veličina fonta
syntax-dark = Tamna tema sintakse
syntax-light = Svetla tema sintakse
default-zoom-step = Podrazumevani korak uvećanja
opacity = Neprozirnost pozadine
### Font
font = Font
advanced-font-settings = Napredna podešavanja fonta
default-font = Font
default-font-size = Veličina fonta
default-font-stretch = Rastezanje fonta
default-font-weight = Debljina normalnog fonta
default-dim-font-weight = Debljina tamnog fonta
default-bold-font-weight = Debljina podebljanog fonta
use-bright-bold = Učini podebljani tekst svetlijim
### Splits
splits = Podele
focus-follow-mouse = Fokus kucanja prati miš
### Advanced
advanced = Napredno
show-headerbar = Prikaži zaglavlje
show-header-description = Otkrijte zaglavlje iz menija desnog klika.
# Find
find-placeholder = Pronađi...
find-previous = Pronađi prethodno
find-next = Pronađi sledeće
# Menu
@ -25,6 +70,8 @@ default-zoom-step = Podrazumevani korak uvećanja
file = Datoteka
new-tab = Nova kartica
new-window = Novi prozor
profile = Profili
menu-profiles = Profili...
close-tab = Zatvori karticu
quit = Izađi
@ -37,7 +84,14 @@ find = Pronađi
## View
view = Prikaz
zoom-in = Veći tekst
zoom-reset = Podrazumevana veličina teksta
zoom-out = Manji tekst
next-tab = Sledeća kartica
previous-tab = Prethodna kartica
split-horizontal = Podeli horizontalno
split-vertical = Podeli vertikalno
pane-toggle-maximize = Maksimizuj
menu-color-schemes = Šeme boja...
menu-settings = Podešavanja...
# Context menu
show-headerbar = Prikaži traku zaglavlja
menu-about = O COSMIC Terminalu...

View file

@ -15,6 +15,9 @@ desktop := APPID + '.desktop'
desktop-src := 'res' / desktop
desktop-dst := clean(rootdir / prefix) / 'share' / 'applications' / desktop
icons-src := 'res' / 'icons' / 'hicolor'
icons-dst := clean(rootdir / prefix) / 'share' / 'icons' / 'hicolor'
# Default recipe which runs `just build-release`
default: build-release
@ -57,7 +60,10 @@ run *args:
# Installs files
install:
install -Dm0755 {{bin-src}} {{bin-dst}}
install -Dm0755 {{desktop-src}} {{desktop-dst}}
install -Dm0644 {{desktop-src}} {{desktop-dst}}
for size in `ls {{icons-src}}`; do \
install -Dm0644 "{{icons-src}}/$size/apps/{{APPID}}.svg" "{{icons-dst}}/$size/apps/{{APPID}}.svg"; \
done
# Uninstalls installed files
uninstall:
@ -65,12 +71,23 @@ uninstall:
# Vendor dependencies locally
vendor:
#!/usr/bin/env bash
mkdir -p .cargo
cargo vendor --sync Cargo.toml \
| head -n -1 > .cargo/config
echo 'directory = "vendor"' >> .cargo/config
tar pcf vendor.tar vendor
rm -rf vendor
cargo vendor --sync Cargo.toml | head -n -1 > .cargo/config.toml
echo 'directory = "vendor"' >> .cargo/config.toml
echo >> .cargo/config.toml
echo '[env]' >> .cargo/config.toml
if [ -n "${SOURCE_DATE_EPOCH}" ]
then
source_date="$(date -d "@${SOURCE_DATE_EPOCH}" "+%Y-%m-%d")"
echo "VERGEN_GIT_COMMIT_DATE = \"${source_date}\"" >> .cargo/config.toml
fi
if [ -n "${SOURCE_GIT_HASH}" ]
then
echo "VERGEN_GIT_SHA = \"${SOURCE_GIT_HASH}\"" >> .cargo/config.toml
fi
tar pcf vendor.tar .cargo vendor
rm -rf .cargo vendor
# Extracts vendored dependencies
vendor-extract:

View file

@ -5,6 +5,6 @@ Exec=cosmic-term
Terminal=false
Type=Application
StartupNotify=true
Icon=utilities-terminal
Icon=com.system76.CosmicTerm
Categories=COSMIC;System;TerminalEmulator;
Keywords=Command;Shell;Terminal;

View file

@ -0,0 +1,11 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_412_3875)">
<path d="M0 0H16V16H0V0Z" fill="#808080" fill-opacity="0.01"/>
<path d="M8 1C6.14348 1 4.36301 1.7375 3.05025 3.05025C1.7375 4.36301 1 6.14348 1 8C1 9.85652 1.7375 11.637 3.05025 12.9497C4.36301 14.2625 6.14348 15 8 15C9.85652 15 11.637 14.2625 12.9497 12.9497C14.2625 11.637 15 9.85652 15 8C15 6.14348 14.2625 4.36301 12.9497 3.05025C11.637 1.7375 9.85652 1 8 1ZM7 3H9V9.004H7V3ZM7 11.004H9V13H7V11.004Z" fill="#F44336"/>
</g>
<defs>
<clipPath id="clip0_412_3875">
<rect width="16" height="16" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 670 B

View file

@ -0,0 +1,18 @@
<svg width="128" height="128" viewBox="0 0 128 128" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="Size=128">
<rect id="Rectangle 418" x="4" y="20" width="120" height="88" rx="8" fill="url(#paint0_linear_2056_1671)"/>
<path id="Subtract" fill-rule="evenodd" clip-rule="evenodd" d="M12 20C7.58172 20 4 23.5817 4 28V100C4 104.418 7.58172 108 12 108H116C120.418 108 124 104.418 124 100V28C124 23.5817 120.418 20 116 20H12ZM12 24C9.79086 24 8 25.7909 8 28V100C8 102.209 9.79086 104 12 104H116C118.209 104 120 102.209 120 100V28C120 25.7909 118.209 24 116 24H12Z" fill="url(#paint1_linear_2056_1671)"/>
<rect id="Rectangle 493" x="34" y="61" width="22" height="5" rx="2.5" fill="#FFAD00"/>
<path id="Rectangle 494" d="M24.487 36.8379C30.1547 42.3686 39 51 39 51C39 51 30.3318 59.4586 24.487 65.1621C23.5799 66.0472 22.2193 66.4897 20.8587 65.1621C19.4981 63.8344 19.9516 62.5067 20.8587 61.6215C25.2866 57.3007 31.7435 51 31.7435 51C31.7435 51 25.1095 44.5264 20.8587 40.3785C19.9516 39.4933 19.4981 38.1656 20.8587 36.8379C22.2193 35.5103 23.5799 35.9528 24.487 36.8379Z" fill="#FFAD00"/>
</g>
<defs>
<linearGradient id="paint0_linear_2056_1671" x1="124" y1="20" x2="3.05838" y2="106.686" gradientUnits="userSpaceOnUse">
<stop stop-color="#243C5F"/>
<stop offset="1" stop-color="#102A4C"/>
</linearGradient>
<linearGradient id="paint1_linear_2056_1671" x1="124" y1="20" x2="3.05838" y2="106.686" gradientUnits="userSpaceOnUse">
<stop stop-color="#BEBEBE"/>
<stop offset="1" stop-color="#9E9E9E"/>
</linearGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View file

@ -0,0 +1,18 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="Size=16">
<rect id="Rectangle 418" x="1" y="3" width="14" height="10" rx="1.5" fill="url(#paint0_linear_2056_1666)"/>
<path id="Subtract" fill-rule="evenodd" clip-rule="evenodd" d="M2.5 3C1.67157 3 1 3.67157 1 4.5V11.5C1 12.3284 1.67157 13 2.5 13H13.5C14.3284 13 15 12.3284 15 11.5V4.5C15 3.67157 14.3284 3 13.5 3H2.5ZM3 4C2.44772 4 2 4.44772 2 5V11C2 11.5523 2.44772 12 3 12H13C13.5523 12 14 11.5523 14 11V5C14 4.44772 13.5523 4 13 4H3Z" fill="url(#paint1_linear_2056_1666)"/>
<rect id="Rectangle 493" x="7" y="10" width="4" height="1" rx="0.5" fill="#FFAD00"/>
<path id="Rectangle 494" d="M4.94463 5.16759C6.13782 6.27371 8 8 8 8C8 8 6.17511 9.69172 4.94463 10.8324C4.75366 11.0094 4.46722 11.0979 4.18078 10.8324C3.89434 10.5669 3.98982 10.3013 4.18078 10.1243C5.11297 9.26015 6.47231 8 6.47231 8C6.47231 8 5.07568 6.70529 4.18078 5.87569C3.98982 5.69867 3.89434 5.43313 4.18078 5.16759C4.46722 4.90205 4.75366 4.99056 4.94463 5.16759Z" fill="#FFAD00"/>
</g>
<defs>
<linearGradient id="paint0_linear_2056_1666" x1="15" y1="3" x2="1.14429" y2="13.1961" gradientUnits="userSpaceOnUse">
<stop stop-color="#243C5F"/>
<stop offset="1" stop-color="#102A4C"/>
</linearGradient>
<linearGradient id="paint1_linear_2056_1666" x1="29" y1="3" x2="0.780292" y2="23.2268" gradientUnits="userSpaceOnUse">
<stop stop-color="#BEBEBE"/>
<stop offset="1" stop-color="#9E9E9E"/>
</linearGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View file

@ -0,0 +1,18 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="Size=24">
<rect id="Rectangle 418" x="2" y="4" width="20" height="16" rx="2.25" fill="url(#paint0_linear_2056_1667)"/>
<path id="Subtract" fill-rule="evenodd" clip-rule="evenodd" d="M4.25 4C3.00736 4 2 5.00736 2 6.25V17.75C2 18.9926 3.00736 20 4.25 20H19.75C20.9926 20 22 18.9926 22 17.75V6.25C22 5.00736 20.9926 4 19.75 4H4.25ZM4.75 5C3.7835 5 3 5.7835 3 6.75V17.25C3 18.2165 3.7835 19 4.75 19H19.25C20.2165 19 21 18.2165 21 17.25V6.75C21 5.7835 20.2165 5 19.25 5H4.75Z" fill="url(#paint1_linear_2056_1667)"/>
<rect id="Rectangle 493" x="11" y="15" width="7" height="2" rx="1" fill="#FFAD00"/>
<path id="Rectangle 494" d="M7.65309 7.27932C9.74119 9.12286 13 12 13 12C13 12 9.80644 14.8195 7.65309 16.7207C7.31891 17.0157 6.81764 17.1632 6.31637 16.7207C5.8151 16.2781 5.98219 15.8356 6.31637 15.5405C7.94769 14.1002 10.3265 12 10.3265 12C10.3265 12 7.88244 9.84214 6.31637 8.45949C5.98219 8.16444 5.8151 7.72188 6.31637 7.27932C6.81764 6.83675 7.31891 6.98427 7.65309 7.27932Z" fill="#FFAD00"/>
</g>
<defs>
<linearGradient id="paint0_linear_2056_1667" x1="22" y1="4" x2="0.687776" y2="18.0028" gradientUnits="userSpaceOnUse">
<stop stop-color="#243C5F"/>
<stop offset="1" stop-color="#102A4C"/>
</linearGradient>
<linearGradient id="paint1_linear_2056_1667" x1="30" y1="4" x2="1.78029" y2="24.2268" gradientUnits="userSpaceOnUse">
<stop stop-color="#BEBEBE"/>
<stop offset="1" stop-color="#9E9E9E"/>
</linearGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View file

@ -0,0 +1,18 @@
<svg width="256" height="256" viewBox="0 0 256 256" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="Size=256">
<rect id="Rectangle 418" x="8" y="40" width="240" height="176" rx="16" fill="url(#paint0_linear_2056_1672)"/>
<path id="Subtract" fill-rule="evenodd" clip-rule="evenodd" d="M24 40C15.1634 40 8 47.1634 8 56V200C8 208.837 15.1634 216 24 216H232C240.837 216 248 208.837 248 200V56C248 47.1634 240.837 40 232 40H24ZM24 48C19.5817 48 16 51.5817 16 56V200C16 204.418 19.5817 208 24 208H232C236.418 208 240 204.418 240 200V56C240 51.5817 236.418 48 232 48H24Z" fill="url(#paint1_linear_2056_1672)"/>
<rect id="Rectangle 493" x="62" y="112" width="36" height="8" rx="4" fill="#FFAD00"/>
<path id="Rectangle 494" d="M47.0847 73.3407C56.0337 82.1897 70 96 70 96C70 96 56.3133 109.534 47.0847 118.659C45.6525 120.075 43.5042 120.784 41.3559 118.659C39.2076 116.535 39.9237 114.411 41.3559 112.994C48.3473 106.081 58.5423 96 58.5423 96C58.5423 96 48.0676 85.6423 41.3559 79.0055C39.9237 77.5893 39.2076 75.465 41.3559 73.3407C43.5042 71.2164 45.6525 71.9245 47.0847 73.3407Z" fill="#FFAD00"/>
</g>
<defs>
<linearGradient id="paint0_linear_2056_1672" x1="248" y1="40" x2="6.11676" y2="213.373" gradientUnits="userSpaceOnUse">
<stop stop-color="#243C5F"/>
<stop offset="1" stop-color="#102A4C"/>
</linearGradient>
<linearGradient id="paint1_linear_2056_1672" x1="248" y1="40" x2="6.11676" y2="213.373" gradientUnits="userSpaceOnUse">
<stop stop-color="#BEBEBE"/>
<stop offset="1" stop-color="#9E9E9E"/>
</linearGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View file

@ -0,0 +1,18 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="Size=32">
<rect id="Rectangle 418" x="2" y="6" width="28" height="20" rx="3" fill="url(#paint0_linear_2056_1668)"/>
<path id="Subtract" fill-rule="evenodd" clip-rule="evenodd" d="M5 6C3.34315 6 2 7.34315 2 9V23C2 24.6569 3.34315 26 5 26H27C28.6569 26 30 24.6569 30 23V9C30 7.34315 28.6569 6 27 6H5ZM5 7C3.89543 7 3 7.89543 3 9V23C3 24.1046 3.89543 25 5 25H27C28.1046 25 29 24.1046 29 23V9C29 7.89543 28.1046 7 27 7H5Z" fill="url(#paint1_linear_2056_1668)"/>
<rect id="Rectangle 493" x="10" y="17" width="7" height="2" rx="1" fill="#FFAD00"/>
<path id="Rectangle 494" d="M6.65309 9.27932C8.74119 11.1229 12 14 12 14C12 14 8.80644 16.8195 6.65309 18.7207C6.31891 19.0157 5.81764 19.1632 5.31637 18.7207C4.8151 18.2781 4.98219 17.8356 5.31637 17.5405C6.94769 16.1002 9.32655 14 9.32655 14C9.32655 14 6.88244 11.8421 5.31637 10.4595C4.98219 10.1644 4.8151 9.72188 5.31637 9.27932C5.81764 8.83675 6.31891 8.98427 6.65309 9.27932Z" fill="#FFAD00"/>
</g>
<defs>
<linearGradient id="paint0_linear_2056_1668" x1="30" y1="6" x2="2.28857" y2="26.3921" gradientUnits="userSpaceOnUse">
<stop stop-color="#243C5F"/>
<stop offset="1" stop-color="#102A4C"/>
</linearGradient>
<linearGradient id="paint1_linear_2056_1668" x1="30" y1="6" x2="1.78029" y2="26.2268" gradientUnits="userSpaceOnUse">
<stop stop-color="#BEBEBE"/>
<stop offset="1" stop-color="#9E9E9E"/>
</linearGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

@ -0,0 +1,18 @@
<svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="Size=48">
<rect id="Rectangle 418" x="2" y="8" width="44" height="32" rx="3.5" fill="url(#paint0_linear_2056_1669)"/>
<path id="Subtract" fill-rule="evenodd" clip-rule="evenodd" d="M5.5 8C3.567 8 2 9.567 2 11.5V36.5C2 38.433 3.567 40 5.5 40H42.5C44.433 40 46 38.433 46 36.5V11.5C46 9.567 44.433 8 42.5 8H5.5ZM5.75 10C4.7835 10 4 10.7835 4 11.75V36.25C4 37.2165 4.7835 38 5.75 38H42.25C43.2165 38 44 37.2165 44 36.25V11.75C44 10.7835 43.2165 10 42.25 10H5.75Z" fill="url(#paint1_linear_2056_1669)"/>
<rect id="Rectangle 493" x="16" y="26" width="9" height="2" rx="1" fill="#FFAD00"/>
<path id="Rectangle 494" d="M10.3616 14.391C13.3446 16.972 18 21 18 21C18 21 13.4378 24.9473 10.3616 27.609C9.88416 28.022 9.16806 28.2285 8.45195 27.609C7.73585 26.9894 7.97455 26.3698 8.45195 25.9567C10.7824 23.9403 14.1808 21 14.1808 21C14.1808 21 10.6892 17.979 8.45195 16.0433C7.97455 15.6302 7.73585 15.0106 8.45195 14.391C9.16806 13.7715 9.88416 13.978 10.3616 14.391Z" fill="#FFAD00"/>
</g>
<defs>
<linearGradient id="paint0_linear_2056_1669" x1="46" y1="8" x2="1.9052" y2="39.8688" gradientUnits="userSpaceOnUse">
<stop stop-color="#243C5F"/>
<stop offset="1" stop-color="#102A4C"/>
</linearGradient>
<linearGradient id="paint1_linear_2056_1669" x1="46" y1="8" x2="1.65474" y2="39.785" gradientUnits="userSpaceOnUse">
<stop stop-color="#BEBEBE"/>
<stop offset="1" stop-color="#9E9E9E"/>
</linearGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View file

@ -0,0 +1,18 @@
<svg width="64" height="64" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="Size=64">
<rect id="Rectangle 418" x="2" y="10" width="60" height="44" rx="4" fill="url(#paint0_linear_2056_1670)"/>
<path id="Subtract" fill-rule="evenodd" clip-rule="evenodd" d="M6 10C3.79086 10 2 11.7909 2 14V50C2 52.2091 3.79086 54 6 54H58C60.2091 54 62 52.2091 62 50V14C62 11.7909 60.2091 10 58 10H6ZM6 12C4.89543 12 4 12.8954 4 14V50C4 51.1046 4.89543 52 6 52H58C59.1046 52 60 51.1046 60 50V14C60 12.8954 59.1046 12 58 12H6Z" fill="url(#paint1_linear_2056_1670)"/>
<rect id="Rectangle 493" x="19" y="33" width="13" height="3" rx="1.5" fill="#FFAD00"/>
<path id="Rectangle 494" d="M12.8339 18.5028C16.4135 21.8211 22 27 22 27C22 27 16.5253 32.0752 12.8339 35.4972C12.261 36.0283 11.4017 36.2938 10.5423 35.4972C9.68302 34.7006 9.96946 33.904 10.5423 33.3729C13.3389 30.7804 17.4169 27 17.4169 27C17.4169 27 13.227 23.1159 10.5423 20.6271C9.96946 20.096 9.68302 19.2994 10.5423 18.5028C11.4017 17.7062 12.261 17.9717 12.8339 18.5028Z" fill="#FFAD00"/>
</g>
<defs>
<linearGradient id="paint0_linear_2056_1670" x1="62" y1="10" x2="1.52919" y2="53.3431" gradientUnits="userSpaceOnUse">
<stop stop-color="#243C5F"/>
<stop offset="1" stop-color="#102A4C"/>
</linearGradient>
<linearGradient id="paint1_linear_2056_1670" x1="62" y1="10" x2="1.52919" y2="53.3431" gradientUnits="userSpaceOnUse">
<stop stop-color="#BEBEBE"/>
<stop offset="1" stop-color="#9E9E9E"/>
</linearGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View file

@ -0,0 +1,10 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_409_3577)">
<path fill-rule="evenodd" clip-rule="evenodd" d="M10 2C10 1.46957 9.78926 0.960858 9.41418 0.585785C9.03911 0.210712 8.53043 0 8 0C7.46957 0 6.96089 0.210712 6.58582 0.585785C6.21074 0.960858 6 1.46957 6 2C6 2.53043 6.21074 3.03914 6.58582 3.41422C6.96089 3.78929 7.46957 4 8 4C8.53043 4 9.03911 3.78929 9.41418 3.41422C9.78926 3.03914 10 2.53043 10 2ZM10 8C10 7.46957 9.78926 6.96086 9.41418 6.58578C9.03911 6.21071 8.53043 6 8 6C7.46957 6 6.96089 6.21071 6.58582 6.58578C6.21074 6.96086 6 7.46957 6 8C6 8.53043 6.21074 9.03914 6.58582 9.41422C6.96089 9.78929 7.46957 10 8 10C8.53043 10 9.03911 9.78929 9.41418 9.41422C9.78926 9.03914 10 8.53043 10 8ZM10 14C10 13.4696 9.78926 12.9609 9.41418 12.5858C9.03911 12.2107 8.53043 12 8 12C7.46957 12 6.96089 12.2107 6.58582 12.5858C6.21074 12.9609 6 13.4696 6 14C6 14.5304 6.21074 15.0391 6.58582 15.4142C6.96089 15.7893 7.46957 16 8 16C8.53043 16 9.03911 15.7893 9.41418 15.4142C9.78926 15.0391 10 14.5304 10 14Z" fill="#232323"/>
</g>
<defs>
<clipPath id="clip0_409_3577">
<rect width="16" height="16" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

View file

@ -5,6 +5,7 @@ use cosmic::{
theme,
};
use cosmic_text::{Metrics, Stretch, Weight};
use hex_color::HexColor;
use serde::{Deserialize, Serialize};
use std::collections::BTreeMap;
@ -14,7 +15,7 @@ use crate::fl;
pub const CONFIG_VERSION: u64 = 1;
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
pub enum AppTheme {
Dark,
Light,
@ -31,6 +32,145 @@ impl AppTheme {
}
}
#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
pub enum ColorSchemeKind {
Dark,
Light,
}
#[derive(Clone, Copy, Debug, Default, Deserialize, Eq, Ord, PartialEq, PartialOrd, Serialize)]
#[serde(transparent)]
pub struct ColorSchemeId(pub u64);
//TODO: there is a lot of extra code to keep the exported color scheme clean,
//consider how to reduce this
fn de_color_opt<'de, D>(deserializer: D) -> Result<Option<HexColor>, D::Error>
where
D: serde::Deserializer<'de>,
{
let hex_color: HexColor = Deserialize::deserialize(deserializer)?;
Ok(Some(hex_color))
}
fn ser_color_opt<S>(hex_color_opt: &Option<HexColor>, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::Error as _;
match hex_color_opt {
Some(hex_color) => Serialize::serialize(hex_color, serializer),
None => Err(S::Error::custom("ser_color_opt called with None")),
}
}
#[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)]
#[serde(default, deny_unknown_fields)]
pub struct ColorSchemeAnsi {
#[serde(
deserialize_with = "de_color_opt",
serialize_with = "ser_color_opt",
skip_serializing_if = "Option::is_none"
)]
pub black: Option<HexColor>,
#[serde(
deserialize_with = "de_color_opt",
serialize_with = "ser_color_opt",
skip_serializing_if = "Option::is_none"
)]
pub red: Option<HexColor>,
#[serde(
deserialize_with = "de_color_opt",
serialize_with = "ser_color_opt",
skip_serializing_if = "Option::is_none"
)]
pub green: Option<HexColor>,
#[serde(
deserialize_with = "de_color_opt",
serialize_with = "ser_color_opt",
skip_serializing_if = "Option::is_none"
)]
pub yellow: Option<HexColor>,
#[serde(
deserialize_with = "de_color_opt",
serialize_with = "ser_color_opt",
skip_serializing_if = "Option::is_none"
)]
pub blue: Option<HexColor>,
#[serde(
deserialize_with = "de_color_opt",
serialize_with = "ser_color_opt",
skip_serializing_if = "Option::is_none"
)]
pub magenta: Option<HexColor>,
#[serde(
deserialize_with = "de_color_opt",
serialize_with = "ser_color_opt",
skip_serializing_if = "Option::is_none"
)]
pub cyan: Option<HexColor>,
#[serde(
deserialize_with = "de_color_opt",
serialize_with = "ser_color_opt",
skip_serializing_if = "Option::is_none"
)]
pub white: Option<HexColor>,
}
impl ColorSchemeAnsi {
pub fn is_empty(&self) -> bool {
self.black.is_none()
&& self.red.is_none()
&& self.green.is_none()
&& self.yellow.is_none()
&& self.blue.is_none()
&& self.magenta.is_none()
&& self.cyan.is_none()
&& self.white.is_none()
}
}
#[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)]
#[serde(default, deny_unknown_fields)]
pub struct ColorScheme {
pub name: String,
#[serde(
deserialize_with = "de_color_opt",
serialize_with = "ser_color_opt",
skip_serializing_if = "Option::is_none"
)]
pub foreground: Option<HexColor>,
#[serde(
deserialize_with = "de_color_opt",
serialize_with = "ser_color_opt",
skip_serializing_if = "Option::is_none"
)]
pub background: Option<HexColor>,
#[serde(
deserialize_with = "de_color_opt",
serialize_with = "ser_color_opt",
skip_serializing_if = "Option::is_none"
)]
pub cursor: Option<HexColor>,
#[serde(
deserialize_with = "de_color_opt",
serialize_with = "ser_color_opt",
skip_serializing_if = "Option::is_none"
)]
pub bright_foreground: Option<HexColor>,
#[serde(
deserialize_with = "de_color_opt",
serialize_with = "ser_color_opt",
skip_serializing_if = "Option::is_none"
)]
pub dim_foreground: Option<HexColor>,
#[serde(skip_serializing_if = "ColorSchemeAnsi::is_empty")]
pub normal: ColorSchemeAnsi,
#[serde(skip_serializing_if = "ColorSchemeAnsi::is_empty")]
pub bright: ColorSchemeAnsi,
#[serde(skip_serializing_if = "ColorSchemeAnsi::is_empty")]
pub dim: ColorSchemeAnsi,
}
#[derive(Clone, Copy, Debug, Default, Deserialize, Eq, Ord, PartialEq, PartialOrd, Serialize)]
#[serde(transparent)]
pub struct ProfileId(pub u64);
@ -63,6 +203,8 @@ impl Default for Profile {
#[derive(Clone, CosmicConfigEntry, Debug, Deserialize, Eq, PartialEq, Serialize)]
pub struct Config {
pub app_theme: AppTheme,
pub color_schemes_dark: BTreeMap<ColorSchemeId, ColorScheme>,
pub color_schemes_light: BTreeMap<ColorSchemeId, ColorScheme>,
pub font_name: String,
pub font_size: u16,
pub font_weight: u16,
@ -77,6 +219,7 @@ pub struct Config {
pub syntax_theme_dark: String,
pub syntax_theme_light: String,
pub focus_follow_mouse: bool,
pub default_profile: Option<ProfileId>,
}
impl Default for Config {
@ -84,6 +227,8 @@ impl Default for Config {
Self {
app_theme: AppTheme::System,
bold_font_weight: Weight::BOLD.0,
color_schemes_dark: BTreeMap::new(),
color_schemes_light: BTreeMap::new(),
dim_font_weight: Weight::NORMAL.0,
focus_follow_mouse: false,
font_name: "Fira Mono".to_string(),
@ -97,11 +242,63 @@ impl Default for Config {
syntax_theme_dark: "COSMIC Dark".to_string(),
syntax_theme_light: "COSMIC Light".to_string(),
use_bright_bold: false,
default_profile: None,
}
}
}
impl Config {
pub fn color_schemes(
&self,
color_scheme_kind: ColorSchemeKind,
) -> &BTreeMap<ColorSchemeId, ColorScheme> {
match color_scheme_kind {
ColorSchemeKind::Dark => &self.color_schemes_dark,
ColorSchemeKind::Light => &self.color_schemes_light,
}
}
pub fn color_schemes_mut(
&mut self,
color_scheme_kind: ColorSchemeKind,
) -> &mut BTreeMap<ColorSchemeId, ColorScheme> {
match color_scheme_kind {
ColorSchemeKind::Dark => &mut self.color_schemes_dark,
ColorSchemeKind::Light => &mut self.color_schemes_light,
}
}
pub fn color_scheme_kind(&self) -> ColorSchemeKind {
if self.app_theme.theme().theme_type.is_dark() {
ColorSchemeKind::Dark
} else {
ColorSchemeKind::Light
}
}
// Get a sorted and adjusted for duplicates list of color scheme names and ids
pub fn color_scheme_names(
&self,
color_scheme_kind: ColorSchemeKind,
) -> Vec<(String, ColorSchemeId)> {
let color_schemes = self.color_schemes(color_scheme_kind);
let mut color_scheme_names =
Vec::<(String, ColorSchemeId)>::with_capacity(color_schemes.len());
for (color_scheme_id, color_scheme) in color_schemes.iter() {
let mut name = color_scheme.name.clone();
let mut copies = 1;
while color_scheme_names.iter().find(|x| x.0 == name).is_some() {
copies += 1;
name = format!("{} ({})", color_scheme.name, copies);
}
color_scheme_names.push((name, *color_scheme_id));
}
color_scheme_names.sort_by(|a, b| lexical_sort::natural_lexical_cmp(&a.0, &b.0));
color_scheme_names
}
fn font_size_adjusted(&self, zoom_adj: i8) -> f32 {
let font_size = f32::from(self.font_size).max(1.0);
let adj = f32::from(zoom_adj);
@ -120,7 +317,7 @@ impl Config {
(self.opacity as f32) / 100.0
}
// Get a sorted and adjusted for duplicates list of profiles names and ids
// Get a sorted and adjusted for duplicates list of profile names and ids
pub fn profile_names(&self) -> Vec<(String, ProfileId)> {
let mut profile_names = Vec::<(String, ProfileId)>::with_capacity(self.profiles.len());
for (profile_id, profile) in self.profiles.iter() {
@ -139,24 +336,20 @@ impl Config {
}
// Get current syntax theme based on dark mode
pub fn syntax_theme(&self, profile_id_opt: Option<ProfileId>) -> &str {
let dark = self.app_theme.theme().theme_type.is_dark();
match profile_id_opt.and_then(|profile_id| self.profiles.get(&profile_id)) {
Some(profile) => {
if dark {
&profile.syntax_theme_dark
} else {
&profile.syntax_theme_light
}
}
None => {
if dark {
&self.syntax_theme_dark
} else {
&self.syntax_theme_light
}
}
}
pub fn syntax_theme(&self, profile_id_opt: Option<ProfileId>) -> (String, ColorSchemeKind) {
let color_scheme_kind = self.color_scheme_kind();
let theme_name = match profile_id_opt.and_then(|profile_id| self.profiles.get(&profile_id))
{
Some(profile) => match color_scheme_kind {
ColorSchemeKind::Dark => profile.syntax_theme_dark.clone(),
ColorSchemeKind::Light => profile.syntax_theme_light.clone(),
},
None => match color_scheme_kind {
ColorSchemeKind::Dark => self.syntax_theme_dark.clone(),
ColorSchemeKind::Light => self.syntax_theme_light.clone(),
},
};
(theme_name, color_scheme_kind)
}
pub fn typed_font_stretch(&self) -> Stretch {

View file

@ -30,11 +30,13 @@ impl IconCache {
};
}
bundle!("dialog-error-symbolic", 16);
bundle!("edit-clear-symbolic", 16);
bundle!("edit-delete-symbolic", 16);
bundle!("list-add-symbolic", 16);
bundle!("go-down-symbolic", 16);
bundle!("go-up-symbolic", 16);
bundle!("view-more-symbolic", 16);
bundle!("window-close-symbolic", 16);
Self { cache }

View file

@ -70,6 +70,7 @@ pub fn key_binds() -> HashMap<KeyBind, Action> {
bind!([Ctrl, Shift], Key::Character("V".into()), Paste);
bind!([Shift], Key::Named(Named::Insert), PastePrimary);
bind!([Ctrl, Shift], Key::Character("W".into()), TabClose);
bind!([Ctrl], Key::Character(",".into()), Settings);
// Ctrl+Alt+D splits horizontally, Ctrl+Alt+R splits vertically, Ctrl+Shift+X maximizes split
//TODO: Adjust bindings as desired by UX

File diff suppressed because it is too large Load diff

View file

@ -17,7 +17,7 @@ use cosmic::{
};
use std::collections::HashMap;
use crate::{fl, Action, Config, KeyBind, Message};
use crate::{fl, Action, ColorSchemeId, ColorSchemeKind, Config, KeyBind, Message};
macro_rules! menu_button {
($($x:expr),+ $(,)?) => (
@ -108,6 +108,42 @@ pub fn context_menu<'a>(
.into()
}
pub fn color_scheme_menu<'a>(
kind: ColorSchemeKind,
id: ColorSchemeId,
name: &str,
) -> Element<'a, Message> {
let menu_item = |label, message| menu_button!(widget::text(label)).on_press(message);
widget::container(column!(
menu_item(
fl!("rename"),
Message::ColorSchemeRename(kind, id, name.to_string())
),
menu_item(fl!("export"), Message::ColorSchemeExport(kind, id)),
menu_item(fl!("delete"), Message::ColorSchemeDelete(kind, id)),
))
.padding(1)
//TODO: move style to libcosmic
.style(theme::Container::custom(|theme| {
let cosmic = theme.cosmic();
let component = &cosmic.background.component;
widget::container::Appearance {
icon_color: Some(component.on.into()),
text_color: Some(component.on.into()),
background: Some(Background::Color(component.base.into())),
border: Border {
radius: 8.0.into(),
width: 1.0,
color: component.divider.into(),
},
..Default::default()
}
}))
.width(Length::Fixed(120.0))
.into()
}
pub fn menu_bar<'a>(config: &Config, key_binds: &HashMap<KeyBind, Action>) -> Element<'a, Message> {
//TODO: port to libcosmic
let menu_root = |label| {
@ -185,7 +221,13 @@ pub fn menu_bar<'a>(config: &Config, key_binds: &HashMap<KeyBind, Action>) -> El
menu_item(fl!("split-vertical"), Action::PaneSplitVertical),
menu_item(fl!("pane-toggle-maximize"), Action::PaneToggleMaximized),
MenuTree::new(horizontal_rule(1)),
menu_item(
fl!("menu-color-schemes"),
Action::ColorSchemes(config.color_scheme_kind()),
),
menu_item(fl!("menu-settings"), Action::Settings),
MenuTree::new(horizontal_rule(1)),
menu_item(fl!("menu-about"), Action::About),
],
),
])

View file

@ -39,7 +39,7 @@ use tokio::sync::mpsc;
pub use alacritty_terminal::grid::Scroll as TerminalScroll;
use crate::{
config::{Config as AppConfig, ProfileId},
config::{ColorSchemeKind, Config as AppConfig, ProfileId},
mouse_reporter::MouseReporter,
};
@ -505,10 +505,14 @@ impl Terminal {
let mut term = self.term.lock();
let grid = term.grid();
let start = Point::new(Line(-(grid.history_size() as i32)), Column(0));
let end = Point::new(
Line(grid.screen_lines() as i32 - 1),
Column(grid.columns() - 1),
);
let mut end_line = grid.bottommost_line();
while end_line.0 > 0 {
if !grid[end_line].is_clear() {
break;
}
end_line.0 -= 1;
}
let end = Point::new(end_line, Column(grid.columns() - 1));
let mut selection = Selection::new(SelectionType::Lines, start, Side::Left);
selection.update(end, Side::Right);
term.selection = Some(selection);
@ -519,7 +523,7 @@ impl Terminal {
pub fn set_config(
&mut self,
config: &AppConfig,
themes: &HashMap<String, Colors>,
themes: &HashMap<(String, ColorSchemeKind), Colors>,
zoom_adj: i8,
) {
let mut update_cell_size = false;
@ -559,7 +563,7 @@ impl Terminal {
update_cell_size = true;
}
if let Some(colors) = themes.get(config.syntax_theme(self.profile_id_opt)) {
if let Some(colors) = themes.get(&config.syntax_theme(self.profile_id_opt)) {
let mut changed = false;
for i in 0..color::COUNT {
if self.colors[i] != colors[i] {

View file

@ -2,11 +2,14 @@ use alacritty_terminal::{
term::color::Colors,
vte::ansi::{NamedColor, Rgb},
};
use hex_color::HexColor;
use palette::{encoding::Srgb, rgb::Rgb as PRgb, FromColor, Okhsl};
use std::collections::HashMap;
use std::{collections::HashMap, fs};
use crate::config::{ColorScheme, ColorSchemeAnsi, ColorSchemeKind};
// Fill missing dim/bright colors with derived values from normal ones.
#[allow(dead_code)]
struct ColorDerive {
dim_saturation_adjustment: f32,
dim_lightness_adjustment: f32,
@ -14,6 +17,7 @@ struct ColorDerive {
bright_lightness_adjustment: f32,
}
#[allow(dead_code)]
impl ColorDerive {
fn new() -> Self {
Self {
@ -138,311 +142,108 @@ fn auto_colors() -> Colors {
colors
}
fn tango_palette() -> Colors {
let mut colors = auto_colors();
impl From<&ColorScheme> for Colors {
fn from(color_scheme: &ColorScheme) -> Self {
let mut colors = auto_colors();
let encode_rgb = |data: u32| -> Rgb {
Rgb {
r: (data >> 16) as u8,
g: (data >> 8) as u8,
b: data as u8,
let encode_rgb = |rgb_opt: Option<HexColor>| -> Option<Rgb> {
let rgb = rgb_opt?;
Some(Rgb {
r: rgb.r,
g: rgb.g,
b: rgb.b,
})
};
// Set normal colors
colors[NamedColor::Black] = encode_rgb(color_scheme.normal.black);
colors[NamedColor::Red] = encode_rgb(color_scheme.normal.red);
colors[NamedColor::Green] = encode_rgb(color_scheme.normal.green);
colors[NamedColor::Yellow] = encode_rgb(color_scheme.normal.yellow);
colors[NamedColor::Blue] = encode_rgb(color_scheme.normal.blue);
colors[NamedColor::Magenta] = encode_rgb(color_scheme.normal.magenta);
colors[NamedColor::Cyan] = encode_rgb(color_scheme.normal.cyan);
colors[NamedColor::White] = encode_rgb(color_scheme.normal.white);
// Set bright colors
colors[NamedColor::BrightBlack] = encode_rgb(color_scheme.bright.black);
colors[NamedColor::BrightRed] = encode_rgb(color_scheme.bright.red);
colors[NamedColor::BrightGreen] = encode_rgb(color_scheme.bright.green);
colors[NamedColor::BrightYellow] = encode_rgb(color_scheme.bright.yellow);
colors[NamedColor::BrightBlue] = encode_rgb(color_scheme.bright.blue);
colors[NamedColor::BrightMagenta] = encode_rgb(color_scheme.bright.magenta);
colors[NamedColor::BrightCyan] = encode_rgb(color_scheme.bright.cyan);
colors[NamedColor::BrightWhite] = encode_rgb(color_scheme.bright.white);
// Set dim colors
colors[NamedColor::DimBlack] = encode_rgb(color_scheme.dim.black);
colors[NamedColor::DimRed] = encode_rgb(color_scheme.dim.red);
colors[NamedColor::DimGreen] = encode_rgb(color_scheme.dim.green);
colors[NamedColor::DimYellow] = encode_rgb(color_scheme.dim.yellow);
colors[NamedColor::DimBlue] = encode_rgb(color_scheme.dim.blue);
colors[NamedColor::DimMagenta] = encode_rgb(color_scheme.dim.magenta);
colors[NamedColor::DimCyan] = encode_rgb(color_scheme.dim.cyan);
colors[NamedColor::DimWhite] = encode_rgb(color_scheme.dim.white);
// Set special colors
colors[NamedColor::Foreground] = encode_rgb(color_scheme.foreground);
colors[NamedColor::Background] = encode_rgb(color_scheme.background);
colors[NamedColor::Cursor] = encode_rgb(color_scheme.cursor);
colors[NamedColor::BrightForeground] = encode_rgb(color_scheme.bright_foreground);
colors[NamedColor::DimForeground] = encode_rgb(color_scheme.dim_foreground);
colors
}
}
impl From<(&str, &Colors)> for ColorScheme {
fn from(tuple: (&str, &Colors)) -> Self {
let (name, colors) = tuple;
let encode_rgb = |rgb_opt: Option<Rgb>| -> Option<HexColor> {
let rgb = rgb_opt?;
Some(HexColor::rgb(rgb.r, rgb.g, rgb.b))
};
Self {
name: name.to_string(),
foreground: encode_rgb(colors[NamedColor::Foreground]),
background: encode_rgb(colors[NamedColor::Background]),
cursor: encode_rgb(colors[NamedColor::Cursor]),
bright_foreground: encode_rgb(colors[NamedColor::BrightForeground]),
dim_foreground: encode_rgb(colors[NamedColor::DimForeground]),
normal: ColorSchemeAnsi {
black: encode_rgb(colors[NamedColor::Black]),
red: encode_rgb(colors[NamedColor::Red]),
green: encode_rgb(colors[NamedColor::Green]),
yellow: encode_rgb(colors[NamedColor::Yellow]),
blue: encode_rgb(colors[NamedColor::Blue]),
magenta: encode_rgb(colors[NamedColor::Magenta]),
cyan: encode_rgb(colors[NamedColor::Cyan]),
white: encode_rgb(colors[NamedColor::White]),
},
bright: ColorSchemeAnsi {
black: encode_rgb(colors[NamedColor::BrightBlack]),
red: encode_rgb(colors[NamedColor::BrightRed]),
green: encode_rgb(colors[NamedColor::BrightGreen]),
yellow: encode_rgb(colors[NamedColor::BrightYellow]),
blue: encode_rgb(colors[NamedColor::BrightBlue]),
magenta: encode_rgb(colors[NamedColor::BrightMagenta]),
cyan: encode_rgb(colors[NamedColor::BrightCyan]),
white: encode_rgb(colors[NamedColor::BrightWhite]),
},
dim: ColorSchemeAnsi {
black: encode_rgb(colors[NamedColor::DimBlack]),
red: encode_rgb(colors[NamedColor::DimRed]),
green: encode_rgb(colors[NamedColor::DimGreen]),
yellow: encode_rgb(colors[NamedColor::DimYellow]),
blue: encode_rgb(colors[NamedColor::DimBlue]),
magenta: encode_rgb(colors[NamedColor::DimMagenta]),
cyan: encode_rgb(colors[NamedColor::DimCyan]),
white: encode_rgb(colors[NamedColor::DimWhite]),
},
}
};
colors[NamedColor::Black] = Some(encode_rgb(0x2E3436));
colors[NamedColor::Red] = Some(encode_rgb(0xCC0000));
colors[NamedColor::Green] = Some(encode_rgb(0x4E9A06));
colors[NamedColor::Yellow] = Some(encode_rgb(0xC4A000));
colors[NamedColor::Blue] = Some(encode_rgb(0x3465A4));
colors[NamedColor::Magenta] = Some(encode_rgb(0x75507B));
colors[NamedColor::Cyan] = Some(encode_rgb(0x06989A));
colors[NamedColor::White] = Some(encode_rgb(0xD3D7CF));
colors[NamedColor::BrightBlack] = Some(encode_rgb(0x555753));
colors[NamedColor::BrightRed] = Some(encode_rgb(0xEF2929));
colors[NamedColor::BrightGreen] = Some(encode_rgb(0x8AE234));
colors[NamedColor::BrightYellow] = Some(encode_rgb(0xFCE94F));
colors[NamedColor::BrightBlue] = Some(encode_rgb(0x729FCF));
colors[NamedColor::BrightMagenta] = Some(encode_rgb(0xAD7FA8));
colors[NamedColor::BrightCyan] = Some(encode_rgb(0x34E2E2));
colors[NamedColor::BrightWhite] = Some(encode_rgb(0xEEEEEC));
colors
}
fn tango_dark() -> Colors {
let mut colors = tango_palette();
// Set special colors
colors[NamedColor::Foreground] = colors[NamedColor::White];
colors[NamedColor::Background] = colors[NamedColor::Black];
colors[NamedColor::BrightForeground] = colors[NamedColor::BrightWhite];
colors[NamedColor::Cursor] = colors[NamedColor::Foreground];
// Fill missing dim colors
ColorDerive::new()
// Dim less so colors are readable with default bg
.with_dim_lightness_adjustment(-0.10)
.fill_missing_dims(&mut colors);
colors
}
fn tango_light() -> Colors {
let mut colors = tango_palette();
// Set special colors
colors[NamedColor::Foreground] = colors[NamedColor::Black];
colors[NamedColor::Background] = colors[NamedColor::BrightWhite];
colors[NamedColor::BrightForeground] = colors[NamedColor::BrightBlack];
colors[NamedColor::Cursor] = colors[NamedColor::Foreground];
// Fill missing dim colors
ColorDerive::new().fill_missing_dims(&mut colors);
colors
}
fn linux_console_palette() -> Colors {
let mut colors = auto_colors();
let encode_rgb = |data: u32| -> Rgb {
Rgb {
r: (data >> 16) as u8,
g: (data >> 8) as u8,
b: data as u8,
}
};
colors[NamedColor::Black] = Some(encode_rgb(0x000000));
colors[NamedColor::Red] = Some(encode_rgb(0xAA0000));
colors[NamedColor::Green] = Some(encode_rgb(0x00AA00));
colors[NamedColor::Yellow] = Some(encode_rgb(0xAA5500));
colors[NamedColor::Blue] = Some(encode_rgb(0x0000AA));
colors[NamedColor::Magenta] = Some(encode_rgb(0xAA00AA));
colors[NamedColor::Cyan] = Some(encode_rgb(0x00AAAA));
colors[NamedColor::White] = Some(encode_rgb(0xAAAAAA));
colors[NamedColor::BrightBlack] = Some(encode_rgb(0x555555));
colors[NamedColor::BrightRed] = Some(encode_rgb(0xFF5555));
colors[NamedColor::BrightGreen] = Some(encode_rgb(0x55FF55));
colors[NamedColor::BrightYellow] = Some(encode_rgb(0xFFFF55));
colors[NamedColor::BrightBlue] = Some(encode_rgb(0x5555FF));
colors[NamedColor::BrightMagenta] = Some(encode_rgb(0xFF55FF));
colors[NamedColor::BrightCyan] = Some(encode_rgb(0x55FFFF));
colors[NamedColor::BrightWhite] = Some(encode_rgb(0xFFFFFF));
colors
}
fn linux_console() -> Colors {
let mut colors = linux_console_palette();
// Set special colors
colors[NamedColor::Foreground] = colors[NamedColor::BrightWhite];
colors[NamedColor::Background] = colors[NamedColor::Black];
colors[NamedColor::BrightForeground] = colors[NamedColor::White];
colors[NamedColor::Cursor] = colors[NamedColor::Foreground];
// Fill missing dim colors
ColorDerive::new()
// Dim less so colors are readable with default bg
.with_dim_lightness_adjustment(-0.10)
.fill_missing_dims(&mut colors);
colors
}
fn xterm_palette() -> Colors {
let mut colors = auto_colors();
let encode_rgb = |data: u32| -> Rgb {
Rgb {
r: (data >> 16) as u8,
g: (data >> 8) as u8,
b: data as u8,
}
};
colors[NamedColor::Black] = Some(encode_rgb(0x000000));
colors[NamedColor::Red] = Some(encode_rgb(0xCD0000));
colors[NamedColor::Green] = Some(encode_rgb(0x00CD00));
colors[NamedColor::Yellow] = Some(encode_rgb(0xCDCD00));
colors[NamedColor::Blue] = Some(encode_rgb(0x0000EE));
colors[NamedColor::Magenta] = Some(encode_rgb(0xCD00CD));
colors[NamedColor::Cyan] = Some(encode_rgb(0x00CDCD));
colors[NamedColor::White] = Some(encode_rgb(0xE5E5E5));
colors[NamedColor::BrightBlack] = Some(encode_rgb(0x7F7F7F));
colors[NamedColor::BrightRed] = Some(encode_rgb(0xFF0000));
colors[NamedColor::BrightGreen] = Some(encode_rgb(0x00FF00));
colors[NamedColor::BrightYellow] = Some(encode_rgb(0xFFFF00));
colors[NamedColor::BrightBlue] = Some(encode_rgb(0x5C5CFF));
colors[NamedColor::BrightMagenta] = Some(encode_rgb(0xFF00FF));
colors[NamedColor::BrightCyan] = Some(encode_rgb(0x00FFFF));
colors[NamedColor::BrightWhite] = Some(encode_rgb(0xFFFFFF));
colors
}
fn xterm_dark() -> Colors {
let mut colors = xterm_palette();
// Set special colors
colors[NamedColor::Foreground] = colors[NamedColor::BrightWhite];
colors[NamedColor::Background] = colors[NamedColor::Black];
colors[NamedColor::BrightForeground] = colors[NamedColor::White];
colors[NamedColor::Cursor] = colors[NamedColor::Foreground];
// Fill missing dim colors
ColorDerive::new()
// Dim less so colors are readable with default bg
.with_dim_lightness_adjustment(-0.12)
.fill_missing_dims(&mut colors);
colors
}
fn xterm_light() -> Colors {
let mut colors = xterm_palette();
// Set special colors
colors[NamedColor::Foreground] = colors[NamedColor::Black];
colors[NamedColor::Background] = colors[NamedColor::BrightWhite];
colors[NamedColor::BrightForeground] = colors[NamedColor::BrightBlack];
colors[NamedColor::Cursor] = colors[NamedColor::Foreground];
// Fill missing dim colors
ColorDerive::new().fill_missing_dims(&mut colors);
colors
}
fn rxvt_palette() -> Colors {
let mut colors = auto_colors();
let encode_rgb = |data: u32| -> Rgb {
Rgb {
r: (data >> 16) as u8,
g: (data >> 8) as u8,
b: data as u8,
}
};
colors[NamedColor::Black] = Some(encode_rgb(0x000000));
colors[NamedColor::Red] = Some(encode_rgb(0xCD0000));
colors[NamedColor::Green] = Some(encode_rgb(0x00CD00));
colors[NamedColor::Yellow] = Some(encode_rgb(0xCDCD00));
colors[NamedColor::Blue] = Some(encode_rgb(0x0000CD));
colors[NamedColor::Magenta] = Some(encode_rgb(0xCD00CD));
colors[NamedColor::Cyan] = Some(encode_rgb(0x00CDCD));
colors[NamedColor::White] = Some(encode_rgb(0xFAEBD7));
colors[NamedColor::BrightBlack] = Some(encode_rgb(0x404040));
colors[NamedColor::BrightRed] = Some(encode_rgb(0xFF0000));
colors[NamedColor::BrightGreen] = Some(encode_rgb(0x00FF00));
colors[NamedColor::BrightYellow] = Some(encode_rgb(0xFFFF00));
colors[NamedColor::BrightBlue] = Some(encode_rgb(0x0000FF));
colors[NamedColor::BrightMagenta] = Some(encode_rgb(0xFF00FF));
colors[NamedColor::BrightCyan] = Some(encode_rgb(0x00FFFF));
colors[NamedColor::BrightWhite] = Some(encode_rgb(0xFFFFFF));
colors
}
fn rxvt_dark() -> Colors {
let mut colors = rxvt_palette();
// Set special colors
colors[NamedColor::Foreground] = colors[NamedColor::BrightWhite];
colors[NamedColor::Background] = colors[NamedColor::Black];
colors[NamedColor::BrightForeground] = colors[NamedColor::White];
colors[NamedColor::Cursor] = colors[NamedColor::Foreground];
// Fill missing dim colors
ColorDerive::new()
// Dim less so colors are readable with default bg
.with_dim_lightness_adjustment(-0.12)
.fill_missing_dims(&mut colors);
colors
}
fn rxvt_light() -> Colors {
let mut colors = rxvt_palette();
// Set special colors
colors[NamedColor::Foreground] = colors[NamedColor::Black];
colors[NamedColor::Background] = colors[NamedColor::BrightWhite];
colors[NamedColor::BrightForeground] = colors[NamedColor::BrightBlack];
colors[NamedColor::Cursor] = colors[NamedColor::Foreground];
// Fill missing dim colors
ColorDerive::new().fill_missing_dims(&mut colors);
colors
}
fn solarized_palette() -> Colors {
let mut colors = auto_colors();
let encode_rgb = |data: u32| -> Rgb {
Rgb {
r: (data >> 16) as u8,
g: (data >> 8) as u8,
b: data as u8,
}
};
colors[NamedColor::Black] = Some(encode_rgb(0x073642));
colors[NamedColor::Red] = Some(encode_rgb(0xDC322F));
colors[NamedColor::Green] = Some(encode_rgb(0x859900));
colors[NamedColor::Yellow] = Some(encode_rgb(0xB58900));
colors[NamedColor::Blue] = Some(encode_rgb(0x268BD2));
colors[NamedColor::Magenta] = Some(encode_rgb(0xD33682));
colors[NamedColor::Cyan] = Some(encode_rgb(0x2AA198));
colors[NamedColor::White] = Some(encode_rgb(0xEEE8D5));
colors[NamedColor::BrightBlack] = Some(encode_rgb(0x002B36));
colors[NamedColor::BrightRed] = Some(encode_rgb(0xCB4B16));
colors[NamedColor::BrightGreen] = Some(encode_rgb(0x586E75));
colors[NamedColor::BrightYellow] = Some(encode_rgb(0x657B83));
colors[NamedColor::BrightBlue] = Some(encode_rgb(0x839496));
colors[NamedColor::BrightMagenta] = Some(encode_rgb(0x6C71C4));
colors[NamedColor::BrightCyan] = Some(encode_rgb(0x93A1A1));
colors[NamedColor::BrightWhite] = Some(encode_rgb(0xFDF6E3));
colors
}
fn solarized_dark() -> Colors {
let mut colors = solarized_palette();
// Set special colors
colors[NamedColor::Foreground] = colors[NamedColor::BrightBlue];
colors[NamedColor::Background] = colors[NamedColor::BrightBlack];
colors[NamedColor::BrightForeground] = colors[NamedColor::Blue];
colors[NamedColor::Cursor] = colors[NamedColor::Foreground];
// Fill missing dim colors
ColorDerive::new().fill_missing_dims(&mut colors);
colors
}
fn solarized_light() -> Colors {
let mut colors = solarized_palette();
// Set special colors
colors[NamedColor::Foreground] = colors[NamedColor::BrightYellow];
colors[NamedColor::Background] = colors[NamedColor::BrightWhite];
colors[NamedColor::BrightForeground] = colors[NamedColor::Yellow];
colors[NamedColor::Cursor] = colors[NamedColor::Foreground];
// Fill missing dim colors
ColorDerive::new().fill_missing_dims(&mut colors);
colors
}
}
fn cosmic_dark() -> Colors {
@ -533,308 +334,50 @@ fn cosmic_light() -> Colors {
colors
}
fn gruvbox_dark() -> Colors {
let mut colors = auto_colors();
let encode_rgb = |data: u32| -> Rgb {
Rgb {
r: (data >> 16) as u8,
g: (data >> 8) as u8,
b: data as u8,
}
};
colors[NamedColor::Black] = Some(encode_rgb(0x282828));
colors[NamedColor::Red] = Some(encode_rgb(0xcc241d));
colors[NamedColor::Green] = Some(encode_rgb(0x98971a));
colors[NamedColor::Yellow] = Some(encode_rgb(0xd79921));
colors[NamedColor::Blue] = Some(encode_rgb(0x458588));
colors[NamedColor::Magenta] = Some(encode_rgb(0xb16286));
colors[NamedColor::Cyan] = Some(encode_rgb(0x689d6a));
colors[NamedColor::White] = Some(encode_rgb(0xa89984));
colors[NamedColor::BrightBlack] = Some(encode_rgb(0x928374));
colors[NamedColor::BrightRed] = Some(encode_rgb(0xfb4934));
colors[NamedColor::BrightGreen] = Some(encode_rgb(0xb8bb26));
colors[NamedColor::BrightYellow] = Some(encode_rgb(0xfabd2f));
colors[NamedColor::BrightBlue] = Some(encode_rgb(0x83a598));
colors[NamedColor::BrightMagenta] = Some(encode_rgb(0xd3869b));
colors[NamedColor::BrightCyan] = Some(encode_rgb(0x8ec07c));
colors[NamedColor::BrightWhite] = Some(encode_rgb(0xebdbb2));
// Set special colors
colors[NamedColor::Foreground] = colors[NamedColor::BrightWhite];
colors[NamedColor::Background] = colors[NamedColor::Black];
colors[NamedColor::Cursor] = colors[NamedColor::BrightWhite];
colors[NamedColor::BrightForeground] = colors[NamedColor::BrightWhite];
// Fill missing dim colors
ColorDerive::new()
// Dim less so colors are readable with default bg
.with_dim_lightness_adjustment(-0.15)
.fill_missing_dims(&mut colors);
colors
}
fn one_half_dark() -> Colors {
let mut colors = auto_colors();
let encode_rgb = |data: u32| -> Rgb {
Rgb {
r: (data >> 16) as u8,
g: (data >> 8) as u8,
b: data as u8,
}
};
colors[NamedColor::Black] = Some(encode_rgb(0x282c34));
colors[NamedColor::Red] = Some(encode_rgb(0xe06c75));
colors[NamedColor::Green] = Some(encode_rgb(0x98c379));
colors[NamedColor::Yellow] = Some(encode_rgb(0xe5c07b));
colors[NamedColor::Blue] = Some(encode_rgb(0x61afef));
colors[NamedColor::Magenta] = Some(encode_rgb(0xc678dd));
colors[NamedColor::Cyan] = Some(encode_rgb(0x56b6c2));
colors[NamedColor::White] = Some(encode_rgb(0xdcdfe4));
colors[NamedColor::BrightBlack] = Some(encode_rgb(0x5d677a));
// Set this before filling bright colors (including BrightForeground)
colors[NamedColor::Foreground] = colors[NamedColor::White];
let color_derive = ColorDerive::new();
// Fill missing bright colors
color_derive.fill_missing_brights(&mut colors);
// Set the rest of special colors
colors[NamedColor::Background] = colors[NamedColor::Black];
colors[NamedColor::Cursor] = colors[NamedColor::BrightWhite];
// Fill missing dim colors
color_derive.fill_missing_dims(&mut colors);
colors
}
fn pop_dark() -> Colors {
let mut colors = auto_colors();
let encode_rgb = |r: u8, g: u8, b: u8| -> Rgb { Rgb { r, g, b } };
// Pop colors (from pop-desktop gsettings)
colors[NamedColor::Black] = Some(encode_rgb(51, 51, 51));
colors[NamedColor::Red] = Some(encode_rgb(204, 0, 0));
colors[NamedColor::Green] = Some(encode_rgb(78, 154, 6));
colors[NamedColor::Yellow] = Some(encode_rgb(196, 160, 0));
colors[NamedColor::Blue] = Some(encode_rgb(52, 101, 164));
colors[NamedColor::Magenta] = Some(encode_rgb(117, 80, 123));
colors[NamedColor::Cyan] = Some(encode_rgb(6, 152, 154));
colors[NamedColor::White] = Some(encode_rgb(211, 215, 207));
colors[NamedColor::BrightBlack] = Some(encode_rgb(136, 128, 124));
colors[NamedColor::BrightRed] = Some(encode_rgb(241, 93, 34));
colors[NamedColor::BrightGreen] = Some(encode_rgb(115, 196, 143));
colors[NamedColor::BrightYellow] = Some(encode_rgb(255, 206, 81));
colors[NamedColor::BrightBlue] = Some(encode_rgb(72, 185, 199));
colors[NamedColor::BrightMagenta] = Some(encode_rgb(173, 127, 168));
colors[NamedColor::BrightCyan] = Some(encode_rgb(52, 226, 226));
colors[NamedColor::BrightWhite] = Some(encode_rgb(238, 238, 236));
// Set special colors
// Pop colors (from pop-desktop gsettings)
colors[NamedColor::Foreground] = Some(encode_rgb(242, 242, 242));
colors[NamedColor::Background] = Some(encode_rgb(51, 51, 51));
colors[NamedColor::Cursor] = colors[NamedColor::BrightWhite];
colors[NamedColor::BrightForeground] = colors[NamedColor::BrightWhite];
// Fill missing dim colors
ColorDerive::new()
// Dim less so colors are readable with default bg
.with_dim_lightness_adjustment(-0.05)
.fill_missing_dims(&mut colors);
colors
}
fn selenized_white() -> Colors {
let mut colors = auto_colors();
let encode_rgb = |data: u32| -> Rgb {
Rgb {
r: (data >> 16) as u8,
g: (data >> 8) as u8,
b: data as u8,
}
};
colors[NamedColor::Black] = Some(encode_rgb(0xEBEBEB));
colors[NamedColor::Red] = Some(encode_rgb(0xD6000C));
colors[NamedColor::Green] = Some(encode_rgb(0x1D9700));
colors[NamedColor::Yellow] = Some(encode_rgb(0xC49700));
colors[NamedColor::Blue] = Some(encode_rgb(0x0064E4));
colors[NamedColor::Magenta] = Some(encode_rgb(0xDD0F9D));
colors[NamedColor::Cyan] = Some(encode_rgb(0x00AD9C));
colors[NamedColor::White] = Some(encode_rgb(0x878787));
colors[NamedColor::BrightBlack] = Some(encode_rgb(0xCDCDCD));
colors[NamedColor::BrightRed] = Some(encode_rgb(0xBF0000));
colors[NamedColor::BrightGreen] = Some(encode_rgb(0x008400));
colors[NamedColor::BrightYellow] = Some(encode_rgb(0xAF8500));
colors[NamedColor::BrightBlue] = Some(encode_rgb(0x0054CF));
colors[NamedColor::BrightMagenta] = Some(encode_rgb(0xC7008B));
colors[NamedColor::BrightCyan] = Some(encode_rgb(0x009A8A));
colors[NamedColor::BrightWhite] = Some(encode_rgb(0x282828));
// Set special colors
colors[NamedColor::Background] = Some(encode_rgb(0xFFFFFF));
colors[NamedColor::Foreground] = Some(encode_rgb(0x474747));
colors[NamedColor::Cursor] = colors[NamedColor::Black];
// Fill missing dim colors
ColorDerive::new().fill_missing_dims(&mut colors);
colors
}
fn selenized_light() -> Colors {
let mut colors = auto_colors();
let encode_rgb = |data: u32| -> Rgb {
Rgb {
r: (data >> 16) as u8,
g: (data >> 8) as u8,
b: data as u8,
}
};
colors[NamedColor::Black] = Some(encode_rgb(0xECE3CC));
colors[NamedColor::Red] = Some(encode_rgb(0xD2212D));
colors[NamedColor::Green] = Some(encode_rgb(0x489100));
colors[NamedColor::Yellow] = Some(encode_rgb(0xAD8900));
colors[NamedColor::Blue] = Some(encode_rgb(0x0072D4));
colors[NamedColor::Magenta] = Some(encode_rgb(0xCA4898));
colors[NamedColor::Cyan] = Some(encode_rgb(0x009C8F));
colors[NamedColor::White] = Some(encode_rgb(0x909995));
colors[NamedColor::BrightBlack] = Some(encode_rgb(0xD5CDB6));
colors[NamedColor::BrightRed] = Some(encode_rgb(0xCC1729));
colors[NamedColor::BrightGreen] = Some(encode_rgb(0x428B00));
colors[NamedColor::BrightYellow] = Some(encode_rgb(0xA78300));
colors[NamedColor::BrightBlue] = Some(encode_rgb(0x006DCE));
colors[NamedColor::BrightMagenta] = Some(encode_rgb(0xC44392));
colors[NamedColor::BrightCyan] = Some(encode_rgb(0x00978A));
colors[NamedColor::BrightWhite] = Some(encode_rgb(0x3A4D53));
// Set special colors
colors[NamedColor::Background] = Some(encode_rgb(0xFBF3DB));
colors[NamedColor::Foreground] = Some(encode_rgb(0x53676D));
colors[NamedColor::Cursor] = colors[NamedColor::Black];
// Fill missing dim colors
ColorDerive::new().fill_missing_dims(&mut colors);
colors
}
fn selenized_dark() -> Colors {
let mut colors = auto_colors();
let encode_rgb = |data: u32| -> Rgb {
Rgb {
r: (data >> 16) as u8,
g: (data >> 8) as u8,
b: data as u8,
}
};
colors[NamedColor::Black] = Some(encode_rgb(0x184956));
colors[NamedColor::Red] = Some(encode_rgb(0xFA5750));
colors[NamedColor::Green] = Some(encode_rgb(0x75B938));
colors[NamedColor::Yellow] = Some(encode_rgb(0xDBB32D));
colors[NamedColor::Blue] = Some(encode_rgb(0x4695F7));
colors[NamedColor::Magenta] = Some(encode_rgb(0xF275BE));
colors[NamedColor::Cyan] = Some(encode_rgb(0x41C7B9));
colors[NamedColor::White] = Some(encode_rgb(0x72898F));
colors[NamedColor::BrightBlack] = Some(encode_rgb(0x2D5B69));
colors[NamedColor::BrightRed] = Some(encode_rgb(0xFF665C));
colors[NamedColor::BrightGreen] = Some(encode_rgb(0x84C747));
colors[NamedColor::BrightYellow] = Some(encode_rgb(0xEBC13D));
colors[NamedColor::BrightBlue] = Some(encode_rgb(0x58A3FF));
colors[NamedColor::BrightMagenta] = Some(encode_rgb(0xFF84CD));
colors[NamedColor::BrightCyan] = Some(encode_rgb(0x53D6C7));
colors[NamedColor::BrightWhite] = Some(encode_rgb(0xCAD8D9));
// Set special colors
colors[NamedColor::Background] = Some(encode_rgb(0x103C48));
colors[NamedColor::Foreground] = Some(encode_rgb(0xADBCBC));
colors[NamedColor::Cursor] = colors[NamedColor::White];
// Fill missing dim colors
ColorDerive::new().fill_missing_dims(&mut colors);
colors
}
fn selenized_black() -> Colors {
let mut colors = auto_colors();
let encode_rgb = |data: u32| -> Rgb {
Rgb {
r: (data >> 16) as u8,
g: (data >> 8) as u8,
b: data as u8,
}
};
colors[NamedColor::Black] = Some(encode_rgb(0x252525));
colors[NamedColor::Red] = Some(encode_rgb(0xED4A46));
colors[NamedColor::Green] = Some(encode_rgb(0x70B433));
colors[NamedColor::Yellow] = Some(encode_rgb(0xDBB32D));
colors[NamedColor::Blue] = Some(encode_rgb(0x368AEB));
colors[NamedColor::Magenta] = Some(encode_rgb(0xEB6EB7));
colors[NamedColor::Cyan] = Some(encode_rgb(0x3FC5B7));
colors[NamedColor::White] = Some(encode_rgb(0x777777));
colors[NamedColor::BrightBlack] = Some(encode_rgb(0x3B3B3B));
colors[NamedColor::BrightRed] = Some(encode_rgb(0xFF5E56));
colors[NamedColor::BrightGreen] = Some(encode_rgb(0x83C746));
colors[NamedColor::BrightYellow] = Some(encode_rgb(0xEFC541));
colors[NamedColor::BrightBlue] = Some(encode_rgb(0x4F9CFE));
colors[NamedColor::BrightMagenta] = Some(encode_rgb(0xFF81CA));
colors[NamedColor::BrightCyan] = Some(encode_rgb(0x56D8C9));
colors[NamedColor::BrightWhite] = Some(encode_rgb(0xDEDEDE));
// Set special colors
colors[NamedColor::Background] = Some(encode_rgb(0x181818));
colors[NamedColor::Foreground] = Some(encode_rgb(0xB9B9B9));
colors[NamedColor::Cursor] = colors[NamedColor::White];
// Fill missing dim colors
ColorDerive::new().fill_missing_dims(&mut colors);
colors
}
pub fn terminal_themes() -> HashMap<String, Colors> {
// Get builtin themes
pub fn terminal_themes() -> HashMap<(String, ColorSchemeKind), Colors> {
let mut themes = HashMap::new();
themes.insert("Tango Dark".to_string(), tango_dark());
themes.insert("Tango Light".to_string(), tango_light());
themes.insert("XTerm Dark".to_string(), xterm_dark());
themes.insert("XTerm Light".to_string(), xterm_light());
themes.insert("Linux Console".to_string(), linux_console());
themes.insert("Rxvt Dark".to_string(), rxvt_dark());
themes.insert("Rxvt Light".to_string(), rxvt_light());
themes.insert("Solarized Dark".to_string(), solarized_dark());
themes.insert("Solarized Light".to_string(), solarized_light());
themes.insert("COSMIC Dark".to_string(), cosmic_dark());
themes.insert("COSMIC Light".to_string(), cosmic_light());
themes.insert("gruvbox-dark".to_string(), gruvbox_dark());
themes.insert("OneHalfDark".to_string(), one_half_dark());
themes.insert("Pop Dark".to_string(), pop_dark());
themes.insert("Selenized Black".to_string(), selenized_black());
themes.insert("Selenized Dark".to_string(), selenized_dark());
themes.insert("Selenized Light".to_string(), selenized_light());
themes.insert("Selenized White".to_string(), selenized_white());
themes.insert(
("COSMIC Dark".to_string(), ColorSchemeKind::Dark),
cosmic_dark(),
);
themes.insert(
("COSMIC Light".to_string(), ColorSchemeKind::Light),
cosmic_light(),
);
themes
}
// Helper function to export builtin themes to theme files
#[allow(dead_code)]
pub fn export() {
for ((name, _color_scheme_kind), theme) in terminal_themes() {
let color_scheme = ColorScheme::from((name.as_str(), &theme));
// Ensure conversion to and from ColorScheme matches original theme
{
let theme_conv = Colors::from(&color_scheme);
for i in 0..alacritty_terminal::term::color::COUNT {
assert_eq!(theme[i], theme_conv[i]);
}
}
let ron = match ron::ser::to_string_pretty(&color_scheme, ron::ser::PrettyConfig::new()) {
Ok(ok) => ok,
Err(err) => {
log::error!("failed to export {name:?}: {err}");
continue;
}
};
let path = format!("color-schemes/{name}.ron");
match fs::write(&path, ron) {
Ok(()) => {
log::info!("exported {path:?}");
}
Err(err) => {
log::error!("failed to esport {path:?}: {err}");
}
}
}
}