sxhkd: fix service test

Before it generated a nonsense test script.
This commit is contained in:
Robert Helgesson 2021-06-17 00:16:17 +02:00
parent 6cd92c643a
commit a01fe9f81e
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
2 changed files with 12 additions and 16 deletions

View file

@ -72,10 +72,12 @@ in
cfg.extraConfig cfg.extraConfig
]; ];
xsession.initExtra = '' xsession.initExtra =
let
sxhkdCommand = "${cfg.package}/bin/sxhkd ${toString cfg.extraOptions}";
in ''
systemctl --user stop sxhkd.scope 2> /dev/null || true systemctl --user stop sxhkd.scope 2> /dev/null || true
systemd-cat -t sxhkd systemd-run --user --scope -u sxhkd \ systemd-cat -t sxhkd systemd-run --user --scope -u sxhkd ${sxhkdCommand} &
${cfg.package}/bin/sxhkd ${toString cfg.extraOptions} &
''; '';
}; };
} }

View file

@ -1,15 +1,5 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
let
expectedFileRegex = ''
systemctl --user stop sxhkd.scope 2> /dev/null || true
systemd-cat -t sxhkd systemd-run --user --scope -u sxhkd \
@sxhkd@/bin/sxhkd -m 1 &
'';
in
{ {
config = { config = {
xsession = { xsession = {
@ -28,7 +18,11 @@ in
assertFileExists $xsessionFile assertFileExists $xsessionFile
assertFileRegex $xsessionFile ${expectedFileRegex} assertFileContains $xsessionFile \
'systemctl --user stop sxhkd.scope 2> /dev/null || true'
assertFileContains $xsessionFile \
'systemd-cat -t sxhkd systemd-run --user --scope -u sxhkd @sxhkd@/bin/sxhkd -m 1 &'
''; '';
}; };
} }