blob: e61b05977664358c4c43a571c30afaf0fde42271 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
|
{ lib
, mylib
, pkgs
, variant ? "x220"
}:
let
font-size = arg: {
program = "${pkgs.font-size-alacritty}/bin/font-size-alacritty";
args = [arg];
};
configs.default = lib.recursiveUpdate variants.${variant} {
bell.animation = "EaseOut";
bell.duration = 50;
bell.color = "#ff00ff";
colors.cursor.cursor = "#f042b0";
colors.primary.background = "#202220";
colors.primary.foreground = "#f0fff0";
colors.normal.black = "#000000";
colors.normal.red = "#cd0000";
colors.normal.green = "#00cd00";
colors.normal.yellow = "#bc7004";
colors.normal.blue = "#4343be";
colors.normal.magenta = "#cb06cb";
colors.normal.cyan = "#04c9c9";
colors.normal.white = "#bebebe";
colors.bright.black = "#727272";
colors.bright.red = "#fb6262";
colors.bright.green = "#72fb72";
colors.bright.yellow = "#fbfb72";
colors.bright.blue = "#7272fb";
colors.bright.magenta = "#fb53fb";
colors.bright.cyan = "#72fbfb";
colors.bright.white = "#fbfbfb";
draw_bold_text_with_bright_colors = false;
hints.enabled = [
{
regex = "(ipfs:|ipns:|magnet:|mailto:|gemini:|gopher:|https:|http:|news:|file:|git:|ssh:|ftp:)[^\\u0000-\\u001F\\u007F-\\u009F<>\"\\s{-}\\^⟨⟩`]+";
mouse.enabled = true;
post_processing = true;
action = "Select";
}
];
scrolling.multiplier = 8;
};
configs.root = lib.recursiveUpdate configs.default {
colors.primary.background = "#230000";
colors.primary.foreground = "#e0c0c0";
colors.normal.black = "#800000";
};
configs.fzmenu = lib.recursiveUpdate configs.default {
colors.primary.background = "#2A172A";
window.dimensions.columns = 70;
window.dimensions.lines = 9;
};
variants.hidpi = {
font.normal.family = "iosevka tv 2 Light";
font.italic.family = "iosevka tv 2 Light";
font.bold.family = "iosevka tv 2 Medium";
font.bold_italic.family = "iosevka tv 2 Medium";
font.size = 5;
key_bindings = [
{ key = "Up"; mods = "Control"; action = "IncreaseFontSize"; }
{ key = "Down"; mods = "Control"; action = "DecreaseFontSize"; }
{ key = "Down"; mods = "Shift|Control"; action = "ResetFontSize"; }
];
};
variants.x220 = {
font.normal.family = "Clean";
font.bold.family = "Clean";
font.bold.style = "Regular";
font.size = 10;
key_bindings = [
{ key = "Up"; mods = "Shift|Control"; command = font-size "=14"; }
{ key = "Up"; mods = "Control"; command = font-size "+1"; }
{ key = "Down"; mods = "Control"; command = font-size "-1"; }
{ key = "Down"; mods = "Shift|Control"; command = font-size "=0"; }
];
};
alacritty-configs =
pkgs.write "alacritty-configs"
(lib.mapAttrs'
(name: config: lib.nameValuePair "/${name}.json" {
link = pkgs.writeJSON "alacritty-${name}.json" config;
})
configs);
in
pkgs.symlinkJoin {
name = "alacritty-tv";
paths = [
(pkgs.writeDashBin "alacritty" ''
# usage:
# alacritty [--profile=PROFILE] [--singleton] [ARGS...]
# where
# PROFILE must have a corresponding file ${alacritty-configs}/PROFILE.json
set -efu
profile=default
case ''${1-} in
--profile=*)
profile=''${1#--profile=}
shift
esac
config=${alacritty-configs}/$profile.json
if ! test -e "$config"; then
echo "$0: warning: bad profile: $profile; using default instead" >&2
profile=default
config=${alacritty-configs}/default.json
fi
case ''${1-} in
--singleton)
shift
if ! ${pkgs.alacritty}/bin/alacritty --config-file "$config" msg create-window "$@"; then
${pkgs.alacritty}/bin/alacritty --config-file "$config" "$@" &
fi
;;
*)
exec ${pkgs.alacritty}/bin/alacritty --config-file "$config" "$@"
;;
esac
'')
pkgs.alacritty
];
}
|