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"
|
ln -snf "${SCRIPT_DIR}/fastfetch" "${TARGET_CONFIG_DIR}/fastfetch" || cp -r "${SCRIPT_DIR}/fastfetch" "${TARGET_CONFIG_DIR}/fastfetch"
|
||||||
fi
|
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
|
# Wallpapers Deployment
|
||||||
if [ -d "${SCRIPT_DIR}/quickshell/wallpapers" ]; then
|
if [ -d "${SCRIPT_DIR}/quickshell/wallpapers" ]; then
|
||||||
info "Deploying default wallpapers to ~/Pictures/Wallpapers..."
|
info "Deploying default wallpapers to ~/Pictures/Wallpapers..."
|
||||||
|
|||||||
@ -137,11 +137,15 @@ def sync_gtk(bg, surface, current_line, fg, accent, is_dark):
|
|||||||
|
|
||||||
def sync_alacritty(bg, surface, current_line, fg, accent, sub_accent):
|
def sync_alacritty(bg, surface, current_line, fg, accent, sub_accent):
|
||||||
import glob, os, re
|
import glob, os, re
|
||||||
alacritty_dir = os.path.expanduser('~/.config/alacritty')
|
alacritty_dirs = get_app_config_dirs(['alacritty', 'Alacritty'])
|
||||||
os.makedirs(alacritty_dir, exist_ok=True)
|
for fb in [
|
||||||
colors_file = os.path.join(alacritty_dir, 'colors.toml')
|
os.path.expanduser('~/.config/alacritty'),
|
||||||
toml_file = os.path.join(alacritty_dir, 'alacritty.toml')
|
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]
|
colors_block = f"""[colors.primary]
|
||||||
background = "{bg}"
|
background = "{bg}"
|
||||||
foreground = "{fg}"
|
foreground = "{fg}"
|
||||||
@ -174,50 +178,52 @@ magenta = "{sub_accent}"
|
|||||||
cyan = "#80ffea"
|
cyan = "#80ffea"
|
||||||
white = "{fg}"
|
white = "{fg}"
|
||||||
"""
|
"""
|
||||||
try:
|
|
||||||
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):
|
for alacritty_dir in alacritty_dirs:
|
||||||
try:
|
try:
|
||||||
with open(toml_file, 'r', encoding='utf-8') as f:
|
os.makedirs(alacritty_dir, exist_ok=True)
|
||||||
content = f.read()
|
colors_file = os.path.join(alacritty_dir, 'colors.toml')
|
||||||
|
toml_file = os.path.join(alacritty_dir, 'alacritty.toml')
|
||||||
lines = content.splitlines()
|
|
||||||
cleaned_lines = []
|
|
||||||
in_colors = False
|
|
||||||
for line in lines:
|
|
||||||
stripped = line.strip()
|
|
||||||
if stripped.startswith('[colors') or stripped.startswith('[[colors'):
|
|
||||||
in_colors = True
|
|
||||||
continue
|
|
||||||
elif in_colors and stripped.startswith('[') and not stripped.startswith('[colors') and not stripped.startswith('[[colors'):
|
|
||||||
in_colors = False
|
|
||||||
|
|
||||||
if not in_colors:
|
with open(colors_file, 'w', encoding='utf-8') as f:
|
||||||
cleaned_lines.append(line)
|
f.write(colors_block)
|
||||||
|
f.flush()
|
||||||
content = '\n'.join(cleaned_lines)
|
os.fsync(f.fileno())
|
||||||
|
|
||||||
if 'colors.toml' not in content:
|
if os.path.exists(toml_file):
|
||||||
import_line = 'import = ["colors.toml"]\n'
|
with open(toml_file, 'r', encoding='utf-8') as f:
|
||||||
if '[general]' in content:
|
content = f.read()
|
||||||
content = content.replace('[general]', '[general]\n' + import_line)
|
|
||||||
else:
|
|
||||||
content = '[general]\n' + import_line + '\n' + content
|
|
||||||
|
|
||||||
with open(toml_file, 'w', encoding='utf-8') as f:
|
lines = content.splitlines()
|
||||||
f.write(content.strip() + '\n')
|
cleaned_lines = []
|
||||||
|
in_colors = False
|
||||||
|
for line in lines:
|
||||||
|
stripped = line.strip()
|
||||||
|
if stripped.startswith('[colors') or stripped.startswith('[[colors'):
|
||||||
|
in_colors = True
|
||||||
|
continue
|
||||||
|
elif in_colors and stripped.startswith('[') and not stripped.startswith('[colors') and not stripped.startswith('[[colors'):
|
||||||
|
in_colors = False
|
||||||
|
|
||||||
|
if not in_colors:
|
||||||
|
cleaned_lines.append(line)
|
||||||
|
|
||||||
|
content = '\n'.join(cleaned_lines)
|
||||||
|
|
||||||
|
if 'colors.toml' not in content:
|
||||||
|
import_line = 'import = ["colors.toml"]\n'
|
||||||
|
if '[general]' in content:
|
||||||
|
content = content.replace('[general]', '[general]\n' + import_line)
|
||||||
|
else:
|
||||||
|
content = '[general]\n' + import_line + '\n' + content
|
||||||
|
|
||||||
|
with open(toml_file, 'w', encoding='utf-8') as f:
|
||||||
|
f.write(content.strip() + '\n')
|
||||||
|
else:
|
||||||
|
with open(toml_file, 'w', encoding='utf-8') as f:
|
||||||
|
f.write('[general]\nimport = ["colors.toml"]\nlive_config_reload = true\n')
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
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:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user