feat: export master Alacritty configuration to repo, update install.sh symlinks, and add Flatpak Alacritty sync
This commit is contained in:
parent
b50244840e
commit
0b9b7a68eb
40
alacritty/alacritty.toml
Normal file
40
alacritty/alacritty.toml
Normal file
@ -0,0 +1,40 @@
|
||||
[general]
|
||||
import = ["~/.config/alacritty/colors.toml"]
|
||||
working_directory = "None"
|
||||
live_config_reload = true
|
||||
|
||||
[env]
|
||||
TERM = "xterm-256color"
|
||||
WINIT_X11_SCALE_FACTOR = "1.0"
|
||||
|
||||
[window]
|
||||
dimensions = { columns = 100, lines = 30 }
|
||||
dynamic_padding = true
|
||||
decorations = "Full"
|
||||
opacity = 1.0
|
||||
title = "Alacritty@CachyOS"
|
||||
class = { instance = "Alacritty", general = "Alacritty" }
|
||||
decorations_theme_variant = "Dark"
|
||||
|
||||
[scrolling]
|
||||
history = 10000
|
||||
multiplier = 3
|
||||
|
||||
[font]
|
||||
normal = { family = "MonoLisa", style = "Regular" }
|
||||
bold = { family = "MonoLisa", style = "Bold" }
|
||||
italic = { family = "MonoLisa", style = "Italic" }
|
||||
bold_italic = { family = "MonoLisa", style = "Bold Italic" }
|
||||
size = 12.0
|
||||
|
||||
[selection]
|
||||
semantic_escape_chars = ",│`|:\"' ()[]{}<> "
|
||||
save_to_clipboard = true
|
||||
|
||||
[cursor]
|
||||
style = { shape = "Underline", blinking = "Off" }
|
||||
unfocused_hollow = true
|
||||
thickness = 0.15
|
||||
|
||||
[mouse]
|
||||
hide_when_typing = true
|
||||
31
alacritty/colors.toml
Normal file
31
alacritty/colors.toml
Normal file
@ -0,0 +1,31 @@
|
||||
[colors.primary]
|
||||
background = "#22212c"
|
||||
foreground = "#f8f8f2"
|
||||
|
||||
[colors.cursor]
|
||||
text = "#22212c"
|
||||
cursor = "#9580ff"
|
||||
|
||||
[colors.selection]
|
||||
text = "#22212c"
|
||||
background = "#9580ff"
|
||||
|
||||
[colors.normal]
|
||||
black = "#22212c"
|
||||
red = "#ff9580"
|
||||
green = "#8aff80"
|
||||
yellow = "#ffff80"
|
||||
blue = "#9580ff"
|
||||
magenta = "#ff80bf"
|
||||
cyan = "#80ffea"
|
||||
white = "#f8f8f2"
|
||||
|
||||
[colors.bright]
|
||||
black = "#454158"
|
||||
red = "#ff9580"
|
||||
green = "#8aff80"
|
||||
yellow = "#ffff80"
|
||||
blue = "#9580ff"
|
||||
magenta = "#ff80bf"
|
||||
cyan = "#80ffea"
|
||||
white = "#f8f8f2"
|
||||
@ -264,6 +264,13 @@ deploy_configs() {
|
||||
ln -snf "${SCRIPT_DIR}/fastfetch" "${TARGET_CONFIG_DIR}/fastfetch" || cp -r "${SCRIPT_DIR}/fastfetch" "${TARGET_CONFIG_DIR}/fastfetch"
|
||||
fi
|
||||
|
||||
# Alacritty Configuration (Symlinked to repo so quality of life updates apply automatically)
|
||||
if [ -d "${SCRIPT_DIR}/alacritty" ]; then
|
||||
info "Unlinking existing & linking Alacritty configuration..."
|
||||
safe_unlink "${TARGET_CONFIG_DIR}/alacritty"
|
||||
ln -snf "${SCRIPT_DIR}/alacritty" "${TARGET_CONFIG_DIR}/alacritty" || cp -r "${SCRIPT_DIR}/alacritty" "${TARGET_CONFIG_DIR}/alacritty"
|
||||
fi
|
||||
|
||||
# Wallpapers Deployment
|
||||
if [ -d "${SCRIPT_DIR}/quickshell/wallpapers" ]; then
|
||||
info "Deploying default wallpapers to ~/Pictures/Wallpapers..."
|
||||
|
||||
@ -137,10 +137,14 @@ def sync_gtk(bg, surface, current_line, fg, accent, is_dark):
|
||||
|
||||
def sync_alacritty(bg, surface, current_line, fg, accent, sub_accent):
|
||||
import glob, os, re
|
||||
alacritty_dir = os.path.expanduser('~/.config/alacritty')
|
||||
os.makedirs(alacritty_dir, exist_ok=True)
|
||||
colors_file = os.path.join(alacritty_dir, 'colors.toml')
|
||||
toml_file = os.path.join(alacritty_dir, 'alacritty.toml')
|
||||
alacritty_dirs = get_app_config_dirs(['alacritty', 'Alacritty'])
|
||||
for fb in [
|
||||
os.path.expanduser('~/.config/alacritty'),
|
||||
os.path.expanduser('~/.var/app/io.github.alacritty.Alacritty/config/alacritty'),
|
||||
os.path.expanduser('~/.var/app/org.alacritty.Alacritty/config/alacritty')
|
||||
]:
|
||||
if fb not in alacritty_dirs:
|
||||
alacritty_dirs.append(fb)
|
||||
|
||||
colors_block = f"""[colors.primary]
|
||||
background = "{bg}"
|
||||
@ -174,16 +178,19 @@ magenta = "{sub_accent}"
|
||||
cyan = "#80ffea"
|
||||
white = "{fg}"
|
||||
"""
|
||||
|
||||
for alacritty_dir in alacritty_dirs:
|
||||
try:
|
||||
os.makedirs(alacritty_dir, exist_ok=True)
|
||||
colors_file = os.path.join(alacritty_dir, 'colors.toml')
|
||||
toml_file = os.path.join(alacritty_dir, 'alacritty.toml')
|
||||
|
||||
with open(colors_file, 'w', encoding='utf-8') as f:
|
||||
f.write(colors_block)
|
||||
f.flush()
|
||||
os.fsync(f.fileno())
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
if os.path.exists(toml_file):
|
||||
try:
|
||||
with open(toml_file, 'r', encoding='utf-8') as f:
|
||||
content = f.read()
|
||||
|
||||
@ -212,14 +219,13 @@ white = "{fg}"
|
||||
|
||||
with open(toml_file, 'w', encoding='utf-8') as f:
|
||||
f.write(content.strip() + '\n')
|
||||
except Exception:
|
||||
pass
|
||||
else:
|
||||
try:
|
||||
with open(toml_file, 'w', encoding='utf-8') as f:
|
||||
f.write('[general]\nimport = ["colors.toml"]\nlive_config_reload = true\n')
|
||||
except Exception:
|
||||
pass
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
try:
|
||||
os.utime(colors_file, None)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user