feat: Add plover as a systemd service

fix #30
This commit is contained in:
Charlotte 🦝 Delenk 2022-03-06 10:55:53 +01:00
parent d626e7418a
commit 070aa6ff0b
Signed by: darkkirb
GPG key ID: AB2BD8DAF2E37122
2 changed files with 30 additions and 14 deletions

View file

@ -7,12 +7,36 @@ in
pkgs.plover.dev
];
home.file = {
".config/plover/main.json".source = "${plover-src}/plover/assets/main.json";
".config/plover/commands.json".source = "${plover-src}/plover/assets/commands.json";
".config/plover/user.json".text = builtins.toJSON {
"SER/TKPWAL" = "Sergal";
"SERLG" = "Sergal";
"SER/WAL" = "serval";
".config/plover/main.json" = {
source = "${plover-src}/plover/assets/main.json";
onChange = "${pkgs.systemd}/bin/systemctl restart --user plover";
};
".config/plover/commands.json" =
{
source = "${plover-src}/plover/assets/commands.json";
onChange = "${pkgs.systemd}/bin/systemctl restart --user plover";
};
".config/plover/user.json" = {
text = builtins.toJSON {
"SER/TKPWAL" = "Sergal";
"SERLG" = "Sergal";
"SER/WAL" = "serval";
};
onChange = "${pkgs.systemd}/bin/systemctl restart --user plover";
};
};
systemd.user.services.plover = {
Unit = {
Description = "plover";
After = [ "tray.target" ];
PartOf = [ "graphical-session.target" ];
Requires = [ "tray.target" ];
};
Install = {
WantedBy = [ "graphical-session.target" ];
};
Service = {
ExecStart = "${pkgs.plover.dev}/bin/plover";
};
};
}

View file

@ -51,14 +51,6 @@
Return = ''mode "default"'';
};
};
startup = [
{
command = "${pkgs.swayidle}/bin/swayidle -w timeout 300 '${pkgs.swaylock}/bin/swaylock -f -c 000000' timeout 305 '${pkgs.sway}/bin/swaymsg \"output * dpms off\"' resume '${pkgs.sway}/bin/swaymsg \"output * dpms on\"' lock '${pkgs.swaylock}/bin/swaylock -f -c 000000' unlock '${pkgs.procps}/bin/pkill swaylock'";
}
{
command = "${pkgs.plover.dev}/bin/plover";
}
];
};
wrapperFeatures.gtk = true;
};