refactor(hyprland): store keybind chord as string

This commit is contained in:
2026-10-10 14:52:42 -04:00
parent cab608fe4e
commit c49816235b
2 changed files with 5 additions and 17 deletions

View File

@@ -7,7 +7,7 @@
let let
mkBind = keybind: { mkBind = keybind: {
_args = [ _args = [
(lib.concatStringsSep " + " keybind.keys) keybind.keys
(lib.generators.mkLuaInline "hl.dsp.exec_cmd(${toLua keybind.command})") (lib.generators.mkLuaInline "hl.dsp.exec_cmd(${toLua keybind.command})")
]; ];
}; };
@@ -23,10 +23,7 @@ in
config = lib.mkIf config.modules.desktop.session.hyprland.enable { config = lib.mkIf config.modules.desktop.session.hyprland.enable {
registry.keybind.${config.networking.hostName} = { registry.keybind.${config.networking.hostName} = {
hyprland-terminal = { hyprland-terminal = {
keys = [ keys = "SUPER + Return";
"SUPER"
"Return"
];
command = "ghostty"; command = "ghostty";
}; };
}; };

View File

@@ -1,21 +1,12 @@
{ lib, ... }: { lib, ... }:
{ {
checks = [
{
assertion = entries: lib.all (entry: entry.value.keys != [ ]) entries;
message = "Desktop keybinds must set at least one key.";
}
];
type = lib.types.submodule { type = lib.types.submodule {
options = { options = {
keys = lib.mkOption { keys = lib.mkOption {
type = lib.types.listOf lib.types.str; type = lib.types.str;
example = [ example = "SUPER + Return";
"SUPER" description = "Sets the key chord for this desktop keybind.";
"Return"
];
description = "Sets the ordered key parts for this desktop keybind.";
}; };
command = lib.mkOption { command = lib.mkOption {