nixos-configs/modules/hyprland/inputs.nix
matt1432 32e5e90b16
All checks were successful
Discord / discord commits (push) Has been skipped
feat(binto): add logitech mouse
2024-04-20 13:42:51 -04:00

55 lines
1.2 KiB
Nix

{
lib,
osConfig,
...
}: let
inherit (lib) optionals;
inherit (osConfig.services.xserver) xkb;
inherit (osConfig.vars) mainMonitor;
miceNames = [
# Wireless
"razer-razer-naga-pro"
# Wired (it always changes)
"razer-razer-naga-pro-1"
"razer-naga-pro"
"razer-naga-pro-1"
"razer-naga-pro-2"
"razer-naga-pro-3"
"logitech-g502-hero-gaming-mouse"
];
nagaConf = name: {
inherit name;
sensitivity = 0;
accel_profile = "flat";
};
in {
wayland.windowManager.hyprland = {
settings = {
device = map (d: (nagaConf d)) miceNames;
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"
];
exec-once =
optionals (! isNull mainMonitor)
["hyprctl dispatch focusmonitor ${mainMonitor}"];
};
};
}