swayosd: add systemdTarget option
This commit is contained in:
parent
a7117efb37
commit
52a0ff174b
|
@ -43,6 +43,15 @@ in {
|
|||
X display to use.
|
||||
'';
|
||||
};
|
||||
|
||||
systemdTarget = mkOption {
|
||||
type = types.str;
|
||||
default = "graphical-session.target";
|
||||
example = "sway-session.target";
|
||||
description = ''
|
||||
Systemd target to bind to.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
@ -56,8 +65,8 @@ in {
|
|||
services.swayosd = {
|
||||
Unit = {
|
||||
Description = "Volume/backlight OSD indicator";
|
||||
PartOf = [ "graphical-session.target" ];
|
||||
After = [ "graphical-session.target" ];
|
||||
PartOf = [ cfg.systemdTarget ];
|
||||
After = [ cfg.systemdTarget ];
|
||||
ConditionEnvironment = "WAYLAND_DISPLAY";
|
||||
Documentation = "man:swayosd(1)";
|
||||
};
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
display = "DISPLAY";
|
||||
stylePath = "/etc/xdg/swayosd/style.css";
|
||||
topMargin = 0.1;
|
||||
systemdTarget = "test.target";
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
|
@ -26,11 +27,11 @@
|
|||
Type=simple
|
||||
|
||||
[Unit]
|
||||
After=graphical-session.target
|
||||
After=test.target
|
||||
ConditionEnvironment=WAYLAND_DISPLAY
|
||||
Description=Volume/backlight OSD indicator
|
||||
Documentation=man:swayosd(1)
|
||||
PartOf=graphical-session.target
|
||||
PartOf=test.target
|
||||
''
|
||||
}
|
||||
'';
|
||||
|
|
Loading…
Reference in a new issue