mirror of
https://github.com/nix-community/home-manager
synced 2024-11-28 05:59:45 +01:00
465ea1f994
Should fix an issue where swayosd.service would stop without starting again after restarting too quickly. Triggered by ending a Hyprland session and logging in with tuigreet. Related: https://github.com/nix-community/home-manager/pull/4316
40 lines
1 KiB
Nix
40 lines
1 KiB
Nix
{ config, ... }:
|
|
|
|
{
|
|
services.swayosd = {
|
|
enable = true;
|
|
package = config.lib.test.mkStubPackage {
|
|
name = "swayosd";
|
|
outPath = "@swayosd@";
|
|
};
|
|
display = "DISPLAY";
|
|
stylePath = "/etc/xdg/swayosd/style.css";
|
|
topMargin = 0.1;
|
|
};
|
|
|
|
nmt.script = ''
|
|
assertFileContent \
|
|
home-files/.config/systemd/user/swayosd.service \
|
|
${
|
|
builtins.toFile "swayosd.service" ''
|
|
[Install]
|
|
WantedBy=graphical-session.target
|
|
|
|
[Service]
|
|
ExecStart=@swayosd@/bin/swayosd-server --display DISPLAY --style '/etc/xdg/swayosd/style.css' --top-margin 0.100000
|
|
Restart=always
|
|
RestartSec=2s
|
|
Type=simple
|
|
|
|
[Unit]
|
|
After=graphical-session.target
|
|
ConditionEnvironment=WAYLAND_DISPLAY
|
|
Description=Volume/backlight OSD indicator
|
|
Documentation=man:swayosd(1)
|
|
PartOf=graphical-session.target
|
|
StartLimitBurst=5
|
|
StartLimitIntervalSec=10
|
|
''
|
|
}
|
|
'';
|
|
}
|