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:
@@ -46,4 +46,25 @@
|
||||
};
|
||||
|
||||
flake.homeManagerModules.desktopShellDms = import ./_private/hm.nix;
|
||||
|
||||
# DMS IPC commands shared between Niri and Hyprland keybind tables.
|
||||
# Defines flake.lib.dmsIpcBinds so each compositor formats the same
|
||||
# command string in its native shape — Niri attrs vs Hyprland string-list.
|
||||
# Adding a new DMS keybind requires editing this file plus the
|
||||
# per-compositor bind layout, not the command string.
|
||||
flake.lib.dmsIpcBinds = {
|
||||
spotlight = "dms ipc call spotlight toggle";
|
||||
clipboard = "dms ipc call clipboard toggle";
|
||||
notepad = "dms ipc call notepad toggle";
|
||||
notifications = "dms ipc call notifications toggle";
|
||||
processlist = "dms ipc call processlist toggle";
|
||||
# Hyprland prefers focusOrToggle (window-aware); niri subscribes to toggle.
|
||||
processlistFocus = "dms ipc call processlist focusOrToggle";
|
||||
settingsFocus = "dms ipc call settings focusOrToggle";
|
||||
barToggle = ''dms ipc call bar toggle name "Main Bar"; dms ipc call bar toggle name "Bar 2"'';
|
||||
barToggleBar2 = ''dms ipc call bar toggle name "Bar 2"'';
|
||||
ephemera = "dms ipc call ephemera toggle";
|
||||
wallpaperCarousel = "dms ipc call wallpaperCarousel toggle";
|
||||
lock = "dms ipc call lock lock";
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user