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

View File

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