From 84c28e51d8c449011a36271273fa717d0e4ce5dd Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Tue, 12 Nov 2024 20:01:46 -0500 Subject: [PATCH] wayland/helpers: add fallbacks for swayosd if service crashes (#162) --- homeManagerModules/desktop/wayland/helpers.nix | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/homeManagerModules/desktop/wayland/helpers.nix b/homeManagerModules/desktop/wayland/helpers.nix index 1e99663d..801e5e81 100644 --- a/homeManagerModules/desktop/wayland/helpers.nix +++ b/homeManagerModules/desktop/wayland/helpers.nix @@ -6,8 +6,8 @@ }: { brightness = rec { bin = lib.getExe' pkgs.swayosd "swayosd-client"; - up = "${bin} --brightness=raise"; - down = "${bin} --brightness=lower"; + up = "${bin} --brightness=raise || ${lib.getExe pkgs.brightnessctl} s +10%"; + down = "${bin} --brightness=lower || ${lib.getExe pkgs.brightnessctl} s 10%-"; }; media = rec { @@ -43,9 +43,9 @@ volume = rec { bin = lib.getExe' pkgs.swayosd "swayosd-client"; - up = "${bin} --output-volume=raise"; - down = "${bin} --output-volume=lower"; - mute = "${bin} --output-volume=mute-toggle"; - micMute = "${bin} --input-volume=mute-toggle"; + up = "${bin} --output-volume=raise || ${lib.getExe' pkgs.wireplumber "wpctl"} set-volume @DEFAULT_AUDIO_SINK@ 5%+"; + down = "${bin} --output-volume=lower || ${lib.getExe' pkgs.wireplumber "wpctl"} set-volume @DEFAULT_AUDIO_SINK@ 5%-"; + mute = "${bin} --output-volume=mute-toggle || ${lib.getExe' pkgs.wireplumber "wpctl"} set-mute @DEFAULT_AUDIO_SINK@ toggle"; + micMute = "${bin} --input-volume=mute-toggle || ${lib.getExe' pkgs.wireplumber "wpctl"} set-mute @DEFAULT_AUDIO_SOURCE@ toggle"; }; }