refactor(hyprland): inline focus options
This commit is contained in:
@@ -80,26 +80,20 @@
|
||||
settings = {
|
||||
config.general.layout = "dwindle";
|
||||
|
||||
bind = lib.mapAttrsToList (
|
||||
_name: keybind:
|
||||
let
|
||||
focusOptions = lib.filterAttrs (_name: value: value != null) {
|
||||
inherit (keybind.action) direction workspace;
|
||||
};
|
||||
in
|
||||
{
|
||||
_args = [
|
||||
keybind.keys
|
||||
(lib.generators.mkLuaInline (
|
||||
{
|
||||
exec = "hl.dsp.exec_cmd(${lib.generators.toLua { } keybind.action.command})";
|
||||
focus = "hl.dsp.focus(${lib.generators.toLua { } focusOptions})";
|
||||
}
|
||||
.${keybind.action.kind}
|
||||
))
|
||||
];
|
||||
}
|
||||
) (lib.attrByPath [ config.networking.hostName ] { } config.registry.keybind);
|
||||
bind = lib.mapAttrsToList (_name: keybind: {
|
||||
_args = [
|
||||
keybind.keys
|
||||
(lib.generators.mkLuaInline (
|
||||
{
|
||||
exec = "hl.dsp.exec_cmd(${lib.generators.toLua { } keybind.action.command})";
|
||||
focus = "hl.dsp.focus(${
|
||||
lib.generators.toLua { } { inherit (keybind.action) direction workspace; }
|
||||
})";
|
||||
}
|
||||
.${keybind.action.kind}
|
||||
))
|
||||
];
|
||||
}) (lib.attrByPath [ config.networking.hostName ] { } config.registry.keybind);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user