feat: hyprland gestures
This commit is contained in:
parent
c264999fb4
commit
dcfc21469b
4 changed files with 550 additions and 484 deletions
|
|
@ -27,6 +27,8 @@ in {
|
|||
}")
|
||||
hypr.keybindings.binds)}
|
||||
|
||||
${concatStringsSep "\n" (map (gs: toString gs) hypr.gestures.gestures)}
|
||||
|
||||
${concatStringsSep "\n\n" (map (sm: ''
|
||||
bind${concatStringsSep "" sm.enterBind.flags} = ${concatStringsSep " " sm.enterBind.mods}, ${sm.enterBind.key}, submap, ${sm.name}
|
||||
submap = ${sm.name}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
{...}: {
|
||||
imports = [
|
||||
./standard-options.nix
|
||||
./gestures.nix
|
||||
];
|
||||
}
|
||||
|
|
|
|||
61
lib/hyprland/gestures.nix
Normal file
61
lib/hyprland/gestures.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -7,7 +7,8 @@
|
|||
cfg = config.horseman.wm.hyprland;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
horseman.wm.hyprland.config.keybindings = {
|
||||
horseman.wm.hyprland.config = {
|
||||
keybindings = {
|
||||
submaps = [
|
||||
{
|
||||
name = "disable-all";
|
||||
|
|
@ -439,14 +440,14 @@ in {
|
|||
mods = ["SHIFT"];
|
||||
key = "XF86AudioRaiseVolume";
|
||||
dispatcher = "exec";
|
||||
params = "wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%+";
|
||||
params = "wpctl set-volume -l 1.0 @DEFAULT_AUDIO_SINK@ 1%+";
|
||||
}
|
||||
{
|
||||
flags = ["e" "l"];
|
||||
mods = ["SHIFT"];
|
||||
key = "XF86AudioLowerVolume";
|
||||
dispatcher = "exec";
|
||||
params = "wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%-";
|
||||
params = "wpctl set-volume -l 1.0 @DEFAULT_AUDIO_SINK@ 1%-";
|
||||
}
|
||||
{
|
||||
flags = ["e" "l"];
|
||||
|
|
@ -507,4 +508,5 @@ in {
|
|||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue