From 2989870873bea99e7bbe006a6736c0c994c6b277 Mon Sep 17 00:00:00 2001
From: NullBite <me@nullbite.com>
Date: Sun, 12 May 2024 11:09:00 -0400
Subject: [PATCH] hyprland: switch to keybind helper

---
 home/common/wm/default.nix         |  8 ++++++++
 home/sessions/hyprland/default.nix | 15 ++-------------
 2 files changed, 10 insertions(+), 13 deletions(-)

diff --git a/home/common/wm/default.nix b/home/common/wm/default.nix
index ed69d31..286be4f 100644
--- a/home/common/wm/default.nix
+++ b/home/common/wm/default.nix
@@ -14,6 +14,10 @@ in
       example = [ "steam -silent" ];
     };
   };
+
+  imports = [
+    ./keybinds.nix
+  ];
   config = lib.mkIf cfg.enable {
     # Common options for standalone window managers; many of these (or
     # alternatives thereof) are pulled in by desktop environments.
@@ -33,6 +37,8 @@ in
       swayidle
       libsForQt5.qtstyleplugin-kvantum
 
+      playerctl
+
       pcmanfm-qt
       pcmanfm-qt-shim
 
@@ -79,6 +85,8 @@ in
     };
 
     services = {
+      playerctld.enable = mkDefault true;
+
       udiskie = {
         enable = mkDefault true;
         automount = mkDefault false;
diff --git a/home/sessions/hyprland/default.nix b/home/sessions/hyprland/default.nix
index 1395712..62f7505 100644
--- a/home/sessions/hyprland/default.nix
+++ b/home/sessions/hyprland/default.nix
@@ -322,19 +322,8 @@ in
         ];
 
         # repeat, ignore mods
-        bindei = [
-          # Volume controls
-          ",XF86AudioRaiseVolume, exec, ${keysetting} volumeup"
-          ",XF86AudioLowerVolume, exec, ${keysetting} volumedown"
-          ",XF86AudioMute, exec, ${keysetting} mute"
-          ",XF86AudioMicMute, exec, ${keysetting} micmute"
-
-          # brightness
-          ",XF86KbdBrightnessDown, exec, ${keysetting} keydown"
-          ",XF86KbdBrightnessUp, exec, ${keysetting} keyup"
-          ",XF86MonBrightnessDown, exec, ${keysetting} mondown"
-          ",XF86MonBrightnessUp, exec, ${keysetting} monup"
-
+        bindei = lib.mapAttrsToList (keysym: command: ",${keysym}, exec, ${command}") config.nixfiles.common.wm.finalKeybinds
+        ++ [
         ];
 
         bindm = [