1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-27 13:39:46 +01:00

swayosd: add systemdTarget option

This commit is contained in:
David Warde-Farley 2024-06-08 11:41:58 +01:00
parent a7117efb37
commit 52a0ff174b
2 changed files with 14 additions and 4 deletions

View file

@ -43,6 +43,15 @@ in {
X display to use. 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 { config = mkIf cfg.enable {
@ -56,8 +65,8 @@ in {
services.swayosd = { services.swayosd = {
Unit = { Unit = {
Description = "Volume/backlight OSD indicator"; Description = "Volume/backlight OSD indicator";
PartOf = [ "graphical-session.target" ]; PartOf = [ cfg.systemdTarget ];
After = [ "graphical-session.target" ]; After = [ cfg.systemdTarget ];
ConditionEnvironment = "WAYLAND_DISPLAY"; ConditionEnvironment = "WAYLAND_DISPLAY";
Documentation = "man:swayosd(1)"; Documentation = "man:swayosd(1)";
}; };

View file

@ -10,6 +10,7 @@
display = "DISPLAY"; display = "DISPLAY";
stylePath = "/etc/xdg/swayosd/style.css"; stylePath = "/etc/xdg/swayosd/style.css";
topMargin = 0.1; topMargin = 0.1;
systemdTarget = "test.target";
}; };
nmt.script = '' nmt.script = ''
@ -26,11 +27,11 @@
Type=simple Type=simple
[Unit] [Unit]
After=graphical-session.target After=test.target
ConditionEnvironment=WAYLAND_DISPLAY ConditionEnvironment=WAYLAND_DISPLAY
Description=Volume/backlight OSD indicator Description=Volume/backlight OSD indicator
Documentation=man:swayosd(1) Documentation=man:swayosd(1)
PartOf=graphical-session.target PartOf=test.target
'' ''
} }
''; '';