Category filter
Script to configure trackpad settings on macOS devices
The trackpad on a Mac replaces the need for a conventional mouse and allows interaction through various gestures and movements. Aimed at enhancing user convenience, macOS offers a wide range of customizable options on Trackpad, including Multi-Touch Gestures and Scroll & Zoom settings. A macOS user can manually configure the Trackpad settings by accessing System Preferences > Trackpad. Alternatively, the administrators can execute the scripts given in this doc using the Execute Custom Script action to customize the trackpad configurations for macOS users.
Scripting language – Bash
File extension – .sh
Configure Tap to click
By default, the Tap to click setting is turned on and the users can tap on the trackpad to perform a click. However, if it is deemed to cause accidental taps leading to unintended actions, you may deploy the following script to turn it off. It enforces the end-user to click on the trackpad (instead of tapping) to initiate an action.
1 2 3 4 5 |
#!/bin/bash loggedInUser="" loggedInUser=`/bin/ls -l /dev/console | /usr/bin/awk '{ print $3 }'` su -l "$loggedInUser" -c "defaults write "com.apple.AppleMultitouchTrackpad" "Clicking" -bool false" launchctl bootout user/$(id -u $loggedInUser) |
You can enable Tap to click, using the following script.
1 2 3 4 5 |
#!/bin/bash loggedInUser="" loggedInUser=`/bin/ls -l /dev/console | /usr/bin/awk '{ print $3 }'` su -l "$loggedInUser" -c "defaults write "com.apple.AppleMultitouchTrackpad" "Clicking" -bool true" launchctl bootout user/$(id -u $loggedInUser) |
Configure trackpad scrolling
You can take advantage of the two-finger scrolling feature on a Mac trackpad, which enables you to effortlessly scroll up or down a page without the need to manually drag the scrollbar. It is enabled by default, but if you prefer to disable it, you can do so using the following script.
1 2 3 4 5 |
#!/bin/bash loggedInUser="" loggedInUser=`/bin/ls -l /dev/console | /usr/bin/awk '{ print $3 }'` su -l "$loggedInUser" -c "defaults write "com.apple.AppleMultitouchTrackpad" "TrackpadScroll" -bool false" launchctl bootout user/$(id -u $loggedInUser) |
To enable trackpad scrolling, deploy the following script.
1 2 3 4 5 |
#!/bin/bash loggedInUser="" loggedInUser=`/bin/ls -l /dev/console | /usr/bin/awk '{ print $3 }'` su -l "$loggedInUser" -c "defaults write "com.apple.AppleMultitouchTrackpad" "TrackpadScroll" -bool true" launchctl bootout user/$(id -u $loggedInUser) |
Configure trackpad momentum scrolling
Momentum scrolling is a feature that allows users to flick the trackpad with their fingers resulting in a smooth scroll through content. It is enabled by default, but if you prefer to disable it, you can use the following script.
1 2 3 4 5 |
#!/bin/bash loggedInUser="" loggedInUser=`/bin/ls -l /dev/console | /usr/bin/awk '{ print $3 }'` su -l "$loggedInUser" -c "defaults write "com.apple.AppleMultitouchTrackpad" "TrackpadMomentumScroll" -bool false" launchctl bootout user/$(id -u $loggedInUser) |
To enable momentum scrolling, use the following script.
1 2 3 4 5 |
#!/bin/bash loggedInUser="" loggedInUser=`/bin/ls -l /dev/console | /usr/bin/awk '{ print $3 }'` su -l "$loggedInUser" -c "defaults write "com.apple.AppleMultitouchTrackpad" "TrackpadMomentumScroll" -bool true" launchctl bootout user/$(id -u $loggedInUser) |
Configure Look up using trackpad
Look up gives you the ability to quickly access definitions, thesaurus entries, and other information about a selected word. With a trackpad, you can do so easily by tapping with three fingers on the selected word. It is enabled by default, but if you prefer to disable it, deploy the following script.
1 2 3 4 5 |
#!/bin/bash loggedInUser="" loggedInUser=`/bin/ls -l /dev/console | /usr/bin/awk '{ print $3 }'` su -l "$loggedInUser" -c "defaults write "com.apple.AppleMultitouchTrackpad" "ForceSuppressed" -bool true" launchctl bootout user/$(id -u $loggedInUser) |
To let users use Look up using trackpad, you can deploy the following script.
1 2 3 4 5 |
#!/bin/bash loggedInUser="" loggedInUser=`/bin/ls -l /dev/console | /usr/bin/awk '{ print $3 }'` su -l "$loggedInUser" -c "defaults write "com.apple.AppleMultitouchTrackpad" "ForceSuppressed" -bool false" launchctl bootout user/$(id -u $loggedInUser) |
Configure Drag Lock
Drag Lock allows users to drag and drop items without holding down on the trackpad. To use Drag Lock, simply tap the trackpad twice and drag the item you want to drag, and then tap it again to drop the item. It is disabled by default. You can deploy the following the script to enable it.
1 2 3 4 5 6 |
#!/bin/bash loggedInUser="" loggedInUser=`/bin/ls -l /dev/console | /usr/bin/awk '{ print $3 }'` su -l "$loggedInUser" -c "defaults write "com.apple.AppleMultitouchTrackpad" "Dragging" -bool true" su -l "$loggedInUser" -c "defaults write "com.apple.AppleMultitouchTrackpad" "DragLock" -bool true" launchctl bootout user/$(id -u $loggedInUser) |
Deploy the following script to disable drag lock.
1 2 3 4 5 6 |
#!/bin/bash loggedInUser="" loggedInUser=`/bin/ls -l /dev/console | /usr/bin/awk '{ print $3 }'` su -l "$loggedInUser" -c "defaults write "com.apple.AppleMultitouchTrackpad" "Dragging" -bool false" su -l "$loggedInUser" -c "defaults write "com.apple.AppleMultitouchTrackpad" "DragLock" -bool false" launchctl bootout user/$(id -u $loggedInUser) |