Move espanso to home-manager

This commit is contained in:
Andreas Zweili 2023-02-20 13:07:30 +01:00
parent bc155e00c2
commit a0faf3ccd7
4 changed files with 30 additions and 29 deletions

View File

@ -6,6 +6,7 @@
"${custom.inputs.self}/home-manager/software/calibre"
"${custom.inputs.self}/home-manager/software/czkawka"
"${custom.inputs.self}/home-manager/software/emacs"
"${custom.inputs.self}/home-manager/software/espanso"
"${custom.inputs.self}/home-manager/software/evince"
"${custom.inputs.self}/home-manager/software/fzf"
"${custom.inputs.self}/home-manager/software/git"

View File

@ -0,0 +1,29 @@
{ ... }:
{
services.espanso = {
enable = true;
settings = {
matches = [
{
trigger = "<dd";
replace = "{{current_date}}";
vars = [{
name = "current_date";
type = "date";
params = { format = "%Y-%m-%d"; };
}];
}
{
trigger = "<ds";
replace = "{{current_date}}";
vars = [{
name = "current_date";
type = "date";
params = { format = "%Y-%m-%d_%H%M%S"; };
}];
}
];
};
};
}

View File

@ -5,7 +5,6 @@
(import "${custom.inputs.self}/modules/droidcam" { inherit custom; })
(import "${custom.inputs.self}/modules/email" { inherit custom; })
(import "${custom.inputs.self}/modules/eog" { inherit custom; })
(import "${custom.inputs.self}/modules/espanso" { inherit custom; })
"${custom.inputs.self}/modules/gnome"
"${custom.inputs.self}/modules/hunspell"
(import "${custom.inputs.self}/modules/libimobiledevice" { inherit custom; })

View File

@ -1,28 +0,0 @@
{ custom }: { ... }:
{
services.espanso.enable = true;
home-manager.users.${custom.username} = {
xdg.configFile.espanso = {
target = "espanso/default.yml";
onChange = "systemctl --user restart espanso";
text = ''
matches:
- trigger: "<dd"
replace: "{{current_date}}"
vars:
- name: current_date
type: date
params:
format: "%Y-%m-%d"
- trigger: "<ds"
replace: "{{current_date}}"
vars:
- name: current_date
type: date
params:
format: "%Y-%m-%d_%H%M%S"
'';
};
};
}