{ config, lib, ... }: with lib; let cfg = config.nixfiles.modules.alacritty; in { options.nixfiles.modules.alacritty.enable = mkEnableOption "Alacritty terminal emulator"; config = mkIf cfg.enable { hm.programs.alacritty = { enable = true; settings = with config.nixfiles.modules; { window = { padding = with config.fontScheme.monospaceFont; { x = size; y = size; }; dynamic_padding = false; decorations = if (kde.enable || gnome.enable) then "full" else "none"; }; font = with config.fontScheme.monospaceFont; { normal = { inherit family; style = "Regular"; }; bold = { inherit family; style = "Bold"; }; italic = { inherit family; style = "Italic"; }; bold_italic = { inherit family; style = "Bold Italic"; }; inherit size; }; colors = with profiles.common.colourScheme; { primary = {inherit background foreground;}; cursor = { text = "CellBackground"; cursor = "CellForeground"; }; vi_mode_cursor = { text = "CellBackground"; cursor = "CellForeground"; }; search = { matches = { foreground = white; background = red; }; focused_match = { foreground = red; background = black; }; bar = { foreground = black; background = white; }; }; hints = { start = { foreground = black; background = yellow; }; end = { foreground = yellow; background = black; }; line_indicator = { foreground = null; background = null; }; selection = { text = "CellBackground"; background = "CellForeground"; }; normal = { inherit black red green yellow blue magenta cyan white; }; bright = { inherit brightBlack brightRed brightGreen brightYellow brightBlue brightMagenta brightCyan brightWhite ; }; }; }; bell = { duration = 0; command = null; # TODO notify-send? }; cursor = { style = { shape = "Block"; blinking = "Off"; }; vi_mode_style = "Block"; }; selection.save_to_clipboard = true; # TODO autocutsel? }; }; }; }