From 49165e30d81f244b3f5dddbc4e238ae0966970fc Mon Sep 17 00:00:00 2001 From: Mohammad Rafiq Date: Tue, 20 May 2025 21:20:09 +0800 Subject: [PATCH] feat(hyprland): add keybinds for audio control --- .../home/desktop/windowManager/hyprland/default.nix | 3 ++- .../home/desktop/windowManager/hyprland/keybinds.nix | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/modules/home/desktop/windowManager/hyprland/default.nix b/modules/home/desktop/windowManager/hyprland/default.nix index d45a54e..8065dec 100644 --- a/modules/home/desktop/windowManager/hyprland/default.nix +++ b/modules/home/desktop/windowManager/hyprland/default.nix @@ -1,4 +1,5 @@ { + pkgs, config, lib, osConfig, @@ -24,7 +25,7 @@ in exec-once = [ "uwsm app -- $LOCKSCREEN" ]; } (import ./decoration.nix) - (import ./keybinds.nix) + (import ./keybinds.nix { inherit pkgs; }) ]; }; xdg.configFile."uwsm/env".text = # sh diff --git a/modules/home/desktop/windowManager/hyprland/keybinds.nix b/modules/home/desktop/windowManager/hyprland/keybinds.nix index 2977e91..cbf5f8f 100644 --- a/modules/home/desktop/windowManager/hyprland/keybinds.nix +++ b/modules/home/desktop/windowManager/hyprland/keybinds.nix @@ -1,5 +1,7 @@ +{ pkgs, ... }: { "$hypr" = "CTRL_SUPER_ALT_SHIFT"; + "$meh" = "CONTROL_SHIFT_ALT"; bind = [ "$hypr, Q, exec, uwsm stop" "SUPER, W, killactive" @@ -23,4 +25,14 @@ "$hypr, H, movetoworkspace, r-1" "$hypr, L, movetoworkspace, r+1" ]; + + bindle = [ + "SUPER, 6, exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%-" + "SUPER, 7, exec, ${pkgs.playerctl}/bin/playerctl previous" + "SUPER, 8, exec, ${pkgs.playerctl}/bin/playerctl play-pause" + "SUPER, 9, exec, ${pkgs.playerctl}/bin/playerctl next" + "SUPER, 0, exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%+" + "$meh, mouse_up, resizeactive, 10% 10%" + "$meh, mouse_down, resizeactive, -10% -10%" + ]; }