Refactor DMS IPC bindings for Niri and Hyprland

- Updated `binds.nix` files for both Niri and Hyprland to utilize a centralized `dmsIpcBinds` structure, improving maintainability and consistency across keybindings.
- Introduced `dmsIpcBinds` in `default.nix` for both modules to streamline the command definitions for DMS IPC calls.
- Enhanced `dms` module to define shared IPC commands, ensuring uniform command formatting for different compositors.
This commit is contained in:
2026-07-13 12:02:06 -03:00
parent 2f28ec735d
commit 9960e874c4
5 changed files with 50 additions and 25 deletions
+11 -11
View File
@@ -1,6 +1,6 @@
{ ... }: {
flake.lib.niriBinds =
{ pkgs, dmsEnabled ? false }:
{ pkgs, dmsEnabled ? false, dmsIpcBinds }:
let
lib = pkgs.lib;
in
@@ -12,16 +12,16 @@
"Mod+E"."spawn-sh" = "nemo";
}
// lib.optionalAttrs dmsEnabled {
"Mod+Space"."spawn-sh" = "dms ipc call spotlight toggle";
"Mod+V"."spawn-sh" = "dms ipc call clipboard toggle";
"Mod+N"."spawn-sh" = "dms ipc call notepad toggle";
"Mod+Shift+N"."spawn-sh" = "dms ipc call notifications toggle";
"Mod+M"."spawn-sh" = "dms ipc call processlist toggle";
"Mod+B"."spawn-sh" = ''dms ipc call bar toggle name "Main Bar"; dms ipc call bar toggle name "Bar 2"'';
"Mod+Shift+B"."spawn-sh" = ''dms ipc call bar toggle name "Bar 2"'';
"Mod+A"."spawn-sh" = "dms ipc call ephemera toggle";
"Mod+numbersign"."spawn-sh" = "dms ipc call wallpaperCarousel toggle";
"Mod+L"."spawn-sh" = "dms ipc call lock lock";
"Mod+Space"."spawn-sh" = dmsIpcBinds.spotlight;
"Mod+V"."spawn-sh" = dmsIpcBinds.clipboard;
"Mod+N"."spawn-sh" = dmsIpcBinds.notepad;
"Mod+Shift+N"."spawn-sh" = dmsIpcBinds.notifications;
"Mod+M"."spawn-sh" = dmsIpcBinds.processlist;
"Mod+B"."spawn-sh" = dmsIpcBinds.barToggle;
"Mod+Shift+B"."spawn-sh" = dmsIpcBinds.barToggleBar2;
"Mod+A"."spawn-sh" = dmsIpcBinds.ephemera;
"Mod+numbersign"."spawn-sh" = dmsIpcBinds.wallpaperCarousel;
"Mod+L"."spawn-sh" = dmsIpcBinds.lock;
}
// {
"Mod+Q"."close-window" = _: { };