feat: hyprland gestures

This commit is contained in:
KoenDR06 2025-12-04 18:08:06 +01:00
parent c264999fb4
commit dcfc21469b
4 changed files with 550 additions and 484 deletions

61
lib/hyprland/gestures.nix Normal file
View file

@ -0,0 +1,61 @@
{lib, ...}: let
inherit (lib) mkOption types;
inherit (builtins) concatStringsSep;
# v0.52.1
# gesture = fingers, direction, action, options
gesture =
types.submodule {
options = {
fingers = mkOption {
type = types.ints.positive;
};
direction = mkOption {
type = types.enum ["swipe" "horizontal" "vertical" "left" "right" "up" "down" "pinch" "pinchin" "pinchout"];
};
mods = mkOption {
type = types.listOf types.str;
default = [];
};
scale = mkOption {
type = types.numbers.positive;
default = 1;
};
action = mkOption {
type = types.enum ["dispatcher" "workspace" "move" "resize" "special" "close" "fullscreen" "float"];
};
options = mkOption {
type = types.listOf types.str;
default = [];
};
};
}
// {
};
in {
options.horseman.wm.hyprland.config = {
gestures.gestures = mkOption {
type = types.listOf gesture;
default = [];
apply = gs:
map (it:
it
// {
__toString = gs: "gesture = ${concatStringsSep ", " (
[
(toString gs.fingers)
(gs.direction)
]
++ map (it: "mod: ${it}") gs.mods
++ [
"scale: ${toString gs.scale}"
(gs.action)
]
++ gs.options
)}";
})
gs;
};
};
}