feat(alacritty): change theme based on dark-notify

This commit is contained in:
2024-06-19 15:31:44 +03:00
parent c6fc3db52f
commit 0ef12b61ac
5 changed files with 142 additions and 23 deletions

View File

@@ -1,26 +1,6 @@
[colors.bright]
black = "0x414868"
blue = "0x7aa2f7"
cyan = "0x7dcfff"
green = "0x9ece6a"
magenta = "0xbb9af7"
red = "0xf7768e"
white = "0xc0caf5"
yellow = "0xe0af68"
[colors.normal]
black = "0x1d202f"
blue = "0x7aa2f7"
cyan = "0x7dcfff"
green = "0x9ece6a"
magenta = "0xbb9af7"
red = "0xf7768e"
white = "0xa9b1d6"
yellow = "0xe0af68"
[colors.primary]
background = "0x24283b"
foreground = "0xc0caf5"
import = [
"~/.dotfiles/config/alacritty/theme-active.toml"
]
[env]
TERM = "xterm-256color"

View File

@@ -0,0 +1,19 @@
#!/usr/bin/env bash
# Adapted from https://gist.github.com/xqm32/17777d035930d622d0ff7530bfab61fd
#
A_DIR="$HOME/.dotfiles/config/alacritty"
set_alacritty_theme() {
cp -f "$A_DIR/theme-$1.toml" "$A_DIR/theme-active.toml"
}
ALACRITTY_THEME=$1
if [ "$ALACRITTY_THEME" = "dark" ] || [ "$ALACRITTY_THEME" = "night" ]; then
set_alacritty_theme "night"
else
set_alacritty_theme "day"
fi
# Notify alacritty about the changes
touch "$A_DIR/alacritty.toml"

View File

@@ -0,0 +1,40 @@
# TokyoNight Alacritty Colors: Day
# Default colors
[colors.primary]
background = '#e1e2e7'
foreground = '#3760bf'
#[colors.cursor]
#cursor = '#3760bf'
#text = '#e1e2e7'
# Normal colors
[colors.normal]
black = '#e9e9ed'
red = '#f52a65'
green = '#587539'
yellow = '#8c6c3e'
blue = '#2e7de9'
magenta = '#9854f1'
cyan = '#007197'
white = '#6172b0'
# Bright colors
[colors.bright]
black = '#a1a6c5'
red = '#f52a65'
green = '#587539'
yellow = '#8c6c3e'
blue = '#2e7de9'
magenta = '#9854f1'
cyan = '#007197'
white = '#3760bf'
# Indexed Colors
[[colors.indexed_colors]]
index = 16
color = '#b15c00'
[[colors.indexed_colors]]
index = 17
color = '#c64343'

View File

@@ -0,0 +1,40 @@
# TokyoNight Alacritty Colors: Day
# Default colors
[colors.primary]
background = '#e1e2e7'
foreground = '#3760bf'
#[colors.cursor]
#cursor = '#3760bf'
#text = '#e1e2e7'
# Normal colors
[colors.normal]
black = '#e9e9ed'
red = '#f52a65'
green = '#587539'
yellow = '#8c6c3e'
blue = '#2e7de9'
magenta = '#9854f1'
cyan = '#007197'
white = '#6172b0'
# Bright colors
[colors.bright]
black = '#a1a6c5'
red = '#f52a65'
green = '#587539'
yellow = '#8c6c3e'
blue = '#2e7de9'
magenta = '#9854f1'
cyan = '#007197'
white = '#3760bf'
# Indexed Colors
[[colors.indexed_colors]]
index = 16
color = '#b15c00'
[[colors.indexed_colors]]
index = 17
color = '#c64343'

View File

@@ -0,0 +1,40 @@
# TokyoNight Alacritty Colors: Storm
# Default colors
[colors.primary]
background = '#24283b'
foreground = '#c0caf5'
#[colors.cursor]
#cursor = '#c0caf5'
#text = '#24283b'
# Normal colors
[colors.normal]
black = '#1d202f'
red = '#f7768e'
green = '#9ece6a'
yellow = '#e0af68'
blue = '#7aa2f7'
magenta = '#bb9af7'
cyan = '#7dcfff'
white = '#a9b1d6'
# Bright colors
[colors.bright]
black = '#414868'
red = '#f7768e'
green = '#9ece6a'
yellow = '#e0af68'
blue = '#7aa2f7'
magenta = '#bb9af7'
cyan = '#7dcfff'
white = '#c0caf5'
# Indexed Colors
[[colors.indexed_colors]]
index = 16
color = '#ff9e64'
[[colors.indexed_colors]]
index = 17
color = '#db4b4b'