LnL7 / nix-darwin

nix modules for darwin
MIT License
3.19k stars 457 forks source link

feature: Add option for disabling pointer acceleration #1008

Open yzhou216 opened 4 months ago

yzhou216 commented 4 months ago

Starting from macOS Sonoma, the default pointer acceleration can be disabled by setting

$ defaults write NSGlobalDomain com.apple.mouse.linear -bool "true"

It would be great if nix-darwin can provide an option like

system.defaults.NSGlobalDomain."com.apple.mouse.linear"

It can also be set or disabled in the GUI by "System Settings > Mouse > Advanced > Pointer acceleration".

yzhou216 commented 4 months ago

I just found out about this issue that was opened a while ago: #788

Pointer acceleration indeed can be disabled by setting system.defaults.".GlobalPreferences"."com.apple.mouse.scaling" to -1.0. However, this was an old hack before Sonoma was released, plus the mouse would become so slow which defeats the purpose.

I found this discussions on Apple Support Community from 2021 which explains the problem pretty well.

Samasaur1 commented 4 months ago

You should be able to do either

system.defaults.CustomSystemPreferences.NSGlobalDomain."com.apple.mouse.linear" = true;

or

system.defaults.CustomUserPreferences.NSGlobalDomain."com.apple.mouse.linear" = true;

(I can never remember which one is the right one to use)

yzhou216 commented 4 months ago

Problem solved!! Thank you :) Closing this issue.

yzhou216 commented 1 month ago

1037 makes this built-in and also completes #788. I'm reopening this.