Hotcorner for High Sierra

ken_tang
New Contributor

I would like to trigger the hotcorner at bottom right corner. But while it is no use for editing the com.apple.dock.plist

Anyone have the experience for hotcorner in High Sierra 10.13.4

Cheers, Ken

2 REPLIES 2

donmontalvo
Esteemed Contributor II

This is actually CIS 2.3.4 for Sierra.

Pretty sure it won't be in the CIS for High Sierra (currently in draft), since it comes with a screen lock shortcut.

This should work for checking if any hot corner is set, if so don't set anything...else set for bottom right.

Since we created this for auditing, we only require a hot corner is set, not which corner...so YMMV.

#!/bin/bash

testFile=/private/tmp/.screenLockTest.txt
testResult=$( cat "$testFile" 2>/dev/null )
over500=$( dscl . list /Users UniqueID | awk '$2 > 500 { print $1 }' )

# Set for User Template
defaults write /System/Library/User Template/English.lproj/Library/Preferences/com.apple.dock wvous-br-corner -int 5
defaults write /System/Library/User Template/English.lproj/Library/Preferences/com.apple.dock wvous-br-modifier -int 0
chown root:wheel /System/Library/User Template/English.lproj/Library/Preferences/com.apple.dock.plist

# Testing users
for u in $over500; do

    bl_corner=$( defaults read /Users/"$u"/Library/Preferences/com.apple.dock wvous-bl-corner 2>/dev/null )
    br_corner=$( defaults read /Users/"$u"/Library/Preferences/com.apple.dock wvous-br-corner 2>/dev/null )
    tl_corner=$( defaults read /Users/"$u"/Library/Preferences/com.apple.dock wvous-tl-corner 2>/dev/null )
    tr_corner=$( defaults read /Users/"$u"/Library/Preferences/com.apple.dock wvous-tr-corner 2>/dev/null )

    # Check if any corner is set to start screensaver
    if [[ "$bl_corner" -ne 5 && "$br_corner" -ne 5 && "$tl_corner" -ne 5 && "$tr_corner" -ne 5 ]]; then
        echo "No hot corner set for $u, setting bottom left corner."
        defaults write /Users/"$u"/Library/Preferences/com.apple.dock wvous-br-corner -int 5
        defaults write /Users/"$u"/Library/Preferences/com.apple.dock wvous-br-modifier -int 0
        chown "$u" /Users/"$u"/Library/Preferences/com.apple.dock.plist
    else
        echo "A hot corner set for $u, nothing to do."
    fi

done

exit 0
--
https://donmontalvo.com

ken_tang
New Contributor

i cannot find the "/System/Library/User Template/English.lproj/" folder, is it normal or manual create a new one?