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

[ad_1]

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 velocity and switch off the pointer acceleration, however I want some automation in the best way of a script I can set off from Raycast. So, I captured the modifications 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 International Area' com.apple.mouse.linear 1
   defaults write 'Apple International Area' com.apple.mouse.scaling 0
else
   defaults write 'Apple International Area' com.apple.mouse.linear 0
   defaults write 'Apple International Area' com.apple.mouse.scaling 0.5
fi

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

This labored flawlessly for a number of weeks. However then about 2 weeks in the past it stopped working, perhaps as a result 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 modifications the pointer acceleration such that I can learn again the defaults and see it’s modified to a price of 1. Nevertheless, The GUI interface reveals it isn’t set to linear. If I manually change it by way of the GUI, the distinction is obvious.
  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 approach of turning acceleration on succeeds, however turning it off fails. I’ve, in fact, repeated my technique of seeing if there are some other modifications within the defaults with the GUI change and I discovered nothing new.

Solutions are appreciated.

HW = 16″ MacBook Professional 2023, Apple M2 Professional

[ad_2]

Leave a Reply

Your email address will not be published. Required fields are marked *