configure mice using DPI instead of speed

This commit is contained in:
Sean Buckley 2021-07-09 22:17:56 -04:00
parent eaf06243f2
commit fa281cbfd4
3 changed files with 14 additions and 1 deletions

View file

@ -8,6 +8,7 @@
baseline = ./modules/baseline.nix; baseline = ./modules/baseline.nix;
cli = ./modules/cli.nix; cli = ./modules/cli.nix;
gnome = ./modules/gnome.nix; gnome = ./modules/gnome.nix;
mouse-dpi = ./modules/mouse-dpi.nix;
phpipam = ./modules/phpipam.nix; phpipam = ./modules/phpipam.nix;
pipewire = ./modules/pipewire.nix; pipewire = ./modules/pipewire.nix;
profiles = ./modules/profiles.nix; profiles = ./modules/profiles.nix;

View file

@ -39,7 +39,6 @@ in
gsettings set org.gnome.desktop.media-handling autorun-never true gsettings set org.gnome.desktop.media-handling autorun-never true
gsettings set org.gnome.desktop.notifications show-in-lock-screen false gsettings set org.gnome.desktop.notifications show-in-lock-screen false
gsettings set org.gnome.desktop.peripherals.mouse middle-click-emulation true gsettings set org.gnome.desktop.peripherals.mouse middle-click-emulation true
gsettings set org.gnome.desktop.peripherals.mouse speed 0.25
gsettings set org.gnome.desktop.privacy recent-files-max-age 30 gsettings set org.gnome.desktop.privacy recent-files-max-age 30
gsettings set org.gnome.desktop.privacy remove-old-temp-files true gsettings set org.gnome.desktop.privacy remove-old-temp-files true
gsettings set org.gnome.desktop.privacy remove-old-trash-files true gsettings set org.gnome.desktop.privacy remove-old-trash-files true

13
modules/mouse-dpi.nix Normal file
View file

@ -0,0 +1,13 @@
{ lib, ... }:
let
dpi = {
"Logitech USB Receiver" = "800@1000";
"Logitech G Pro Gaming Mouse" = "800@1000";
"Logitech G305" = "800@1000";
};
in
{
services.udev.extraHwdb = lib.concatMapStrings
(n: "\nmouse:usb:*:name:${n}:*\n MOUSE_DPI=${dpi.${n}}\n")
(builtins.attrNames dpi);
}