{
  pkgs,
  lib,
  ...
}: {
  services.swayosd.enable = true;

  # Auto-restart swayosd on crash
  systemd.user.services.swayosd = {
    Unit = {
      StartLimitBurst = lib.mkForce 5;
      StartLimitIntervalSec = lib.mkForce 30;
      After = [ "graphical-session.target" ];
      PartOf = [ "graphical-session.target" ];
    };
    Service = {
      Restart = lib.mkForce "on-failure";
      RestartSec = lib.mkForce "1s";
    };
    Install.WantedBy = [ "graphical-session.target" ];
  };

  wayland.windowManager.hyprland.settings = {
    bindel = [
      ", XF86AudioRaiseVolume, exec, swayosd-client --output-volume raise"
      ", XF86AudioLowerVolume, exec, swayosd-client --output-volume lower"
    ];
    bindl = [
      ", XF86AudioMute, exec, swayosd-client --output-volume mute-toggle"
      ", Caps_Lock, exec, sleep 0.1 && swayosd-client --caps-lock"
    ];
  };
}
