Posted on 04-22-2016 07:05 AM
Hi,
I'm struggling with Mission Control's hot corners.
I created a Config Profile from a cleaned com.apple.dock.plist. Everything works, the settings are applied.
The problem is that if the users try to change these hot corners, they get reverted to the ones I set up in the Config Profile.
I used MCXtoProfile with the "--once" option and uploaded the profile but it does the same.
I'd like to avoid the use of a dedicated script and instead use the config profile.
Any tips? Any idea how can set them "once"?
Below the plist file.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>wvous-bl-corner</key>
<integer>4</integer>
<key>wvous-bl-modifier</key>
<integer>0</integer>
<key>wvous-br-corner</key>
<integer>5</integer>
<key>wvous-br-modifier</key>
<integer>0</integer>
<key>wvous-tr-corner</key>
<integer>2</integer>
<key>wvous-tr-modifier</key>
<integer>0</integer>
</dict>
</plist>
Posted on 04-22-2016 07:30 AM
Do it via script. I'm doing something like this, except allowing users to set whatever they want but never allowing A: adding a disable screensaver/lockscreen hotcorner, and B: removal of the lock/screensaver hotcorner.
# Get user logged into console and put into variable "user"
user=`ls -l /dev/console | cut -d " " -f 4`
###
# Set hotcorner actions. Disable "Disable Screen Saver" when found.
###
## The following are the values of each option in the GUI
# Start Screen Saver = 5
# Modifier = 0
# Disable Screen Saver = 6
# Modifier = 0
# Mission Control = 2
# Modifier = 0
# Application Windows = 3
# Modifier = 0
# Desktop = 4
# Modifier = 0
# Dashboard = 7
# Modifier = 0
# Notification Center = 12
# Modifier = 0
# Launchpad = 11
# Modifier = 0
# Put Display to Sleep = 10
# Modifier = 0
# None = 1
# Modifier = 1048576
##
a=`defaults read /Users/$user/Library/Preferences/com.apple.dock.plist | grep "-corner""`
for corner in $a
do
cornerval=`echo $corner | cut -d "=" -f2 | cut -d ";" -f1 | sed 's/ //g'`
corner=`echo $corner | cut -d """ -f 2 | cut -d "-" -f 1,2`
if [ "$cornerval" = "6" ];
then
echo User:Hotcorner - Disable screensaver found on $corner, fixing...
# Setting the corner action to 1(None)
sudo -u $user defaults write /Users/$user/Library/Preferences/com.apple.dock.plist $corner-corner -int 1
sudo -u $user defaults write /Users/$user/Library/Preferences/com.apple.dock.plist $corner-modifier -int 1048576
changesmade="yes"
fi
done
##
# Set bottom left corner of the screen "hotcorner" action to immediately invoke the screensaver
##
needsFixed=0
defaults read /Users/$user/Library/Preferences/com.apple.dock.plist| grep bl-corner | grep 5 > /dev/null
if [ $? != 0 ]; then needsFixed=1;fi
defaults read /Users/$user/Library/Preferences/com.apple.dock.plist | grep bl-modifier | grep -i "s0;" > /dev/null
if [ $? != 0 ]; then needsFixed=1;fi
if [ $needsFixed == 1 ];
then
sudo -u $user defaults write /Users/$user/Library/Preferences/com.apple.dock.plist wvous-bl-corner -int 5
sudo -u $user defaults write /Users/$user/Library/Preferences/com.apple.dock.plist wvous-bl-modifier -int 0
changesmade="yes"
fi
# If changes were made then the dock needs to be restarted for them to take affect
if [ "$changesmade" = "yes" ]; then sudo killall -hup cfprefsd; sudo killall -hup Dock; fi
Posted on 04-22-2016 07:33 AM
I did something a little different. In the example below it sets the lower left (screen saver start) and right hot corners (screensaver delay). Users can't change the two hot corners I set but can change the other two.
Posted on 04-22-2016 07:34 AM
Sorry, just saw you'd like to avoid using a script. Where is your profile? If it's in the user's Library/Preferences folder and they have write access to it, AND you aren't re-deploying it to the user there shouldn't be any problems with the overwriting it.
Posted on 04-22-2016 08:46 AM
Unfortunately not. If I set the config profile at Computer Level, the users' changes keep getting reverted.
Posted on 04-25-2016 12:02 PM
This isn't specific to the dock, but rather config profiles and the JSS. I would avoid using any SET ONCE custom config profiles through Casper. In my testing a year ago or so, the preference being managed "once" will get reset on reboot. Not a good experience obviously. This may also be the case if you deploy a custom config outside of the JSS's MDM (package up the profile and install using the profiles command), but I never tested that.
I would recommend using dockutil and scripting this out even if that's not what you want to do.