2024-05-30 16:54:58 -03:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}:
|
2023-01-24 11:42:49 -03:00
|
|
|
let
|
2024-06-05 01:18:48 -03:00
|
|
|
inherit (config.my)
|
2024-05-30 16:54:58 -03:00
|
|
|
key
|
|
|
|
theme
|
|
|
|
accent
|
|
|
|
font
|
|
|
|
;
|
2023-01-24 11:42:49 -03:00
|
|
|
inherit (theme) color;
|
|
|
|
in
|
|
|
|
{
|
2022-09-16 23:50:28 -03:00
|
|
|
config = {
|
|
|
|
programs.alacritty = {
|
|
|
|
enable = true;
|
|
|
|
settings = {
|
|
|
|
font = {
|
|
|
|
size = font.size.small;
|
2024-05-30 16:54:58 -03:00
|
|
|
normal = {
|
|
|
|
family = font.mono;
|
|
|
|
};
|
2022-09-16 23:50:28 -03:00
|
|
|
};
|
|
|
|
colors = {
|
|
|
|
primary = {
|
|
|
|
background = "${color.bg}";
|
|
|
|
foreground = "${color.txt}";
|
|
|
|
};
|
|
|
|
cursor = {
|
|
|
|
text = "#000000";
|
|
|
|
cursor = "${accent.color}";
|
|
|
|
};
|
|
|
|
normal = {
|
|
|
|
black = "${color.normal.black}";
|
|
|
|
red = "${color.normal.red}";
|
|
|
|
green = "${color.normal.green}";
|
|
|
|
yellow = "${color.normal.yellow}";
|
|
|
|
blue = "${color.normal.blue}";
|
|
|
|
magenta = "${color.normal.magenta}";
|
|
|
|
cyan = "${color.normal.cyan}";
|
|
|
|
white = "${color.normal.white}";
|
|
|
|
};
|
2024-02-10 17:50:58 -03:00
|
|
|
draw_bold_text_with_bright_colors = false;
|
2022-09-16 23:50:28 -03:00
|
|
|
};
|
|
|
|
window = {
|
|
|
|
opacity = theme.opacity / 100.0;
|
|
|
|
dynamic_padding = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
hints = {
|
|
|
|
alphabet = key.hints;
|
2024-05-30 16:54:58 -03:00
|
|
|
enabled = [
|
|
|
|
{
|
|
|
|
regex =
|
|
|
|
let
|
|
|
|
mimes = "(mailto:|gemini:|gopher:|https:|http:|news:|file:|git:|ssh:|ftp:)";
|
|
|
|
# I fucking hate regex, look at this bullshit
|
|
|
|
delimiters = ''^\\u0000-\\u001F\\u007F-\\u009F<>"\\s{-}\\^⟨⟩`'';
|
|
|
|
# Kakoune uses these characters to represent whitespace,
|
|
|
|
# but alacritty doesn't know about them
|
|
|
|
whitespace_characters = ''¬·→'';
|
|
|
|
in
|
|
|
|
"${mimes}[${delimiters}${whitespace_characters}]+";
|
|
|
|
command = "xdg-open";
|
|
|
|
post_processing = true;
|
|
|
|
mouse = {
|
|
|
|
enabled = true;
|
|
|
|
mods = "None";
|
|
|
|
};
|
|
|
|
binding = {
|
|
|
|
key = "U";
|
|
|
|
mods = "Control|Shift";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
mouse = {
|
|
|
|
hide_when_typing = true;
|
2022-09-16 23:50:28 -03:00
|
|
|
};
|
2024-02-10 17:50:58 -03:00
|
|
|
keyboard.bindings = [
|
2022-09-16 23:50:28 -03:00
|
|
|
{
|
|
|
|
key = lib.toUpper key.up;
|
|
|
|
mode = "Vi|~Search";
|
|
|
|
action = "Up";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
key = lib.toUpper key.down;
|
|
|
|
mode = "Vi|~Search";
|
|
|
|
action = "Down";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
key = lib.toUpper key.left;
|
|
|
|
mode = "Vi|~Search";
|
|
|
|
action = "Left";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
key = lib.toUpper key.right;
|
|
|
|
mode = "Vi|~Search";
|
|
|
|
action = "Right";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
key = lib.toUpper key.insertMode;
|
|
|
|
mode = "Vi|~Search";
|
|
|
|
action = "ScrollToBottom";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
key = lib.toUpper key.insertMode;
|
|
|
|
mode = "Vi|~Search";
|
|
|
|
action = "ToggleViMode";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
key = lib.toUpper key.next;
|
|
|
|
mode = "Vi|~Search";
|
|
|
|
action = "SearchNext";
|
|
|
|
}
|
2024-07-18 01:17:07 -03:00
|
|
|
{
|
|
|
|
key = lib.toUpper key.next;
|
|
|
|
mods = "Shift";
|
|
|
|
mode = "Vi|~Search";
|
|
|
|
action = "SearchPrevious";
|
|
|
|
}
|
2022-09-16 23:50:28 -03:00
|
|
|
{
|
|
|
|
key = "Up";
|
|
|
|
mods = "Control|Shift";
|
|
|
|
mode = "~Alt";
|
|
|
|
action = "ScrollLineUp";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
key = "Down";
|
|
|
|
mods = "Control|Shift";
|
|
|
|
mode = "~Alt";
|
|
|
|
action = "ScrollLineDown";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
key = "PageUp";
|
|
|
|
mods = "Control|Shift";
|
|
|
|
mode = "~Alt";
|
|
|
|
action = "ScrollHalfPageUp";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
key = "PageDown";
|
|
|
|
mods = "Control|Shift";
|
|
|
|
mode = "~Alt";
|
|
|
|
action = "ScrollHalfPageDown";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
key = "N";
|
|
|
|
mods = "Control|Shift";
|
|
|
|
action = "SpawnNewInstance";
|
|
|
|
}
|
|
|
|
# {%@@ if key.layout == "colemak" @@%}
|
|
|
|
{
|
|
|
|
key = "T";
|
|
|
|
mode = "Vi|~Search";
|
|
|
|
action = "SemanticRightEnd";
|
|
|
|
}
|
|
|
|
# {%@@ endif @@%}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
2023-01-24 09:40:07 -03:00
|
|
|
|
2024-05-30 16:54:58 -03:00
|
|
|
home.sessionVariables = {
|
|
|
|
TERMINAL = "alacritty";
|
|
|
|
};
|
2023-01-24 09:40:07 -03:00
|
|
|
|
|
|
|
# Look at this fucking bullshit:
|
|
|
|
# https://gitlab.gnome.org/GNOME/glib/-/blob/20c4fcb2a7246a2b205649eae3ebda4296217afc/gio/gdesktopappinfo.c#L2702
|
|
|
|
# Theres a fucking hard coded list of terminals!
|
|
|
|
home.packages = with pkgs; [
|
|
|
|
(pkgs.writeShellScriptBin "gnome-terminal" ''
|
|
|
|
[ "$1" = "--" ] && shift
|
|
|
|
exec terminal -e "$@"
|
|
|
|
'')
|
|
|
|
];
|
2022-09-16 23:50:28 -03:00
|
|
|
};
|
|
|
|
}
|