nixos_config/home/modules/services/espanso.nix
2026-03-13 18:56:34 +01:00

54 lines
1.3 KiB
Nix

{ pkgs, repoRoot, ... }:
{
services.espanso = {
enable = true;
waylandSupport = true;
configs.default = {
toggle_key = "OFF";
preserve_clipboard = true;
show_notifications = true;
keyboard_layout.layout = "se";
};
matches = {
base.matches = [
{
trigger = ";ip ";
replace = "{{pubip}} ";
}
{
trigger = ";gw2hs ";
replace = "Full Homestead ^w^ ";
}
{
regex = ";format (?P<alphabet>\\S+) (?P<text>\\S+) ";
replace = "{{format_text}} ";
vars = [
{
name = "format_text";
type = "shell";
params.cmd = "${pkgs.python3}/bin/python3 ${repoRoot}/util/format_text.py $ESPANSO_ALPHABET $ESPANSO_TEXT";
}
];
}
{
regex = ";;(?P<emname>\\S+) ";
replace = "{{emoji}} ";
vars = [
{
name = "emoji";
type = "shell";
params.cmd = "${pkgs.python3}/bin/python3 ${repoRoot}/util/get_emoji.py $ESPANSO_EMNAME";
}
];
}
];
global_vars.global_vars = [
{
name = "pubip";
type = "shell";
params.cmd = "curl -s https://ifconfig.me";
}
];
};
};
}