nixos-configs/modules/hyprland/inputs.nix

48 lines
1,007 B
Nix
Raw Normal View History

{
lib,
osConfig,
...
}: let
inherit (lib) optionals;
inherit (osConfig.services.xserver) xkb;
inherit (osConfig.vars) mainMonitor;
2024-04-20 13:42:51 -04:00
miceNames = [
"logitech-g502-x"
2024-04-20 13:42:51 -04:00
"logitech-g502-hero-gaming-mouse"
2024-02-09 17:18:07 -05:00
];
nagaConf = name: {
inherit name;
2024-02-09 17:18:07 -05:00
sensitivity = 0;
accel_profile = "flat";
};
in {
wayland.windowManager.hyprland = {
settings = {
2024-04-20 13:42:51 -04:00
device = map (d: (nagaConf d)) miceNames;
2024-02-21 00:20:41 -05:00
input = {
kb_layout = xkb.layout;
kb_variant = xkb.variant;
follow_mouse = true;
touchpad = {
natural_scroll = true;
disable_while_typing = false;
};
};
bind = [
",XF86AudioPlay, exec, playerctl play-pause"
",XF86AudioStop, exec, playerctl stop"
",XF86AudioNext, exec, playerctl next"
",XF86AudioPrev, exec, playerctl previous"
];
2024-02-16 22:02:12 -05:00
exec-once =
optionals (! isNull mainMonitor)
["hyprctl dispatch focusmonitor ${mainMonitor}"];
};
};
}