refactor(hyprland): store keybind chord as string
This commit is contained in:
@@ -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";
|
||||
};
|
||||
};
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user