Automating mouse pointer acceleration adjustments used to work – macOS Sonoma 14.5

0
28


I spend the primary 45 minutes of my workday strolling 4.7 mph on my treadmill which requires a really mellow mouse expertise or each click on turns right into a drag. I can manually change the mouse monitoring pace and switch off the pointer acceleration, however I choose some automation in the best way of a script I can set off from Raycast. So, I captured the adjustments within the preferences by way of defaults learn earlier than and after variations and created this script.

#!/bin/bash

# Set mouse settings for strolling on treadmill or stationary at desk. Argument beginning with t == treadmill
# Should change the defaults after which get them reloaded for them to take impact within the present session.

indicator=${1:0:1}

if [ "$indicator" == 't' ]; then
   defaults write 'Apple World Area' com.apple.mouse.linear 1
   defaults write 'Apple World Area' com.apple.mouse.scaling 0
else
   defaults write 'Apple World Area' com.apple.mouse.linear 0
   defaults write 'Apple World Area' com.apple.mouse.scaling 0.5
fi

# Reload the preferences
/System/Library/PrivateFrameworks/SystemAdministration.framework/Sources/activateSettings -u

This labored flawlessly for a couple of weeks. However then about 2 weeks in the past it stopped working, possibly as a consequence of an IT dept change on my machine. I’m stumped. The habits I now observe is that this:

  1. Giving the “t” argument to the script adjustments the pointer acceleration such that I can learn again the defaults and see it’s modified to a worth of 1. Nevertheless, The GUI interface exhibits it isn’t set to linear. If I manually change it by way of the GUI, the distinction is clear.
  2. When I’ve it manually set and run the script with out the “t”, it succeeds in turning acceleration again on.

So, the automated means of turning acceleration on succeeds, however turning it off fails. I’ve, after all, repeated my technique of seeing if there are some other adjustments within the defaults with the GUI change and I discovered nothing new.

Options are appreciated.

HW = 16″ MacBook Professional 2023, Apple M2 Professional