Posted on 07-23-2013 06:38 AM
An image was create for 30 iMacs using 10.8.3 for a computer lab. The image has been deployed to the iMacs but we have an issue where the right click of the mouse doesn't work. I can make it work by going to system preferences/mouse/ then select 'secondary click' for the right side of the mouse. The problem with that approach is that each user that logs in to the iMacs will have to manually enable right click and have 30 iMacs, isn't an ideal solution.
I was wondering if someone could tell me how can I use composer, casper admin and jss to either create a package or a script to deploy the mouse right click fix to the 30 iMacs.
Cheers,
Henry
Posted on 07-23-2013 07:48 AM
I don't have an iMac here I can test with, but my guess is, if you use Composer in either Snapshot mode or Monitor File System Changes mode, you can go in, make the necessary changes in System Preferences, then close it and see what preference files get updated. Its very likely in the user directory, so you'd need to either use a custom Managed Preference (MCX) or package up the plist and deploy it using FUT (Fill User Template) so whenever a new user logs in they would get the preference pre-populated in their account.
Posted on 07-23-2013 08:01 AM
Unless Apple has changed something since I wrote this script a few years back, the following code snippet should get the "right-click" preference for all Apple branded mice/trackpads written to every user template, which will get applied for all new accounts. I don't usually modify existing user accounts to avoid overwriting preferences that they may have set, but it shouldn't be very difficult to modify it to apply to existing accounts as well.
#!/bin/sh
for i in `ls -1 "/System/Library/User Template"`; do
defaults write "/System/Library/User Template/${i}/Library/Preferences/com.apple.driver.AppleHIDMouse" Button2 -int 2
defaults write "/System/Library/User Template/${i}/Library/Preferences/com.apple.driver.AppleBluetoothMultitouch.mouse" MouseButtonMode -string TwoButton
defaults write "/System/Library/User Template/${i}/Library/Preferences/com.apple.driver.AppleBluetoothMultitouch.trackpad" TrackpadRightClick -int 1
done
Posted on 07-23-2013 09:10 AM
There are many ways to accomplish this... however, it may be worth familiarizing your user base with System preferences.
Quick question though, while you could package the plist in composer, that's a little kludgy for just a plist change. Do you use either MCX or profiles? It would be far easier to leverage those for these purposes. Otherwise you could write a simple script to modify the three files mentioned by Josh_S. Just strip out references to the templates folder and substitute a command similar to:
defaults write ~/Library/Preferences/com.apple.driver.AppleHIDMouse Button2 -int 2
defaults write ~/Library/Preferences/com.apple.driver.AppleBluetoothMultitouch.mouse MouseButtonMode -string TwoButton
defaults write ~/Library/Preferences/com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadRightClick -int 1
Now... I haven't tested this in any way shape or form. Really, I just took the script form above and replaced the path to the user templates with ~/
If used in a self service policy that will run that command on the logged user. Otherwise you could just hit them all by using /Volumes/"Volume Name"/Users/*/ though using wildcards like that can be risky. Hopefully someone with far better scripting skills than I might jump in here soon. Josh S's looks good though.
Posted on 07-23-2013 05:17 PM
We use MCX for Apple Mighty Mouse.
Posted on 07-24-2013 02:25 PM
Thanks for the replies guys, I will try both methods and go from there. Had a question for mm2270. Will I need to create a DMG first then take the plist out of the DMG and then build it as a package?.
I did try the Snapshot mode or Monitor File System Changes which I create a package from but for some reason even though it will let me enable FUT in casper admin, I wouldn't let me enable it once I'm inside the casper JSS.
Regards,
Henry
Posted on 04-08-2015 05:15 AM
@Josh_S The Code still works even for Yosemite, I have just added it to my Login Script :) and Bobs your uncle!
Posted on 04-16-2015 04:13 PM
@Catcoteacademy I'm glad to hear the @Josh_S code still works in Yosemite. I'll have to try to modify that code to do the admin account as well. Would be great if this could be done via a configuration profile.