Posted on 08-22-2019 01:57 PM
Hey All,
I'm trying to run a command that will allow me to add the screen lock to touchbar.
I've been using the following command.
defaults write com.apple.controlstrip MiniCustomized -array-add com.apple.system.screen-lock
killall ControlStrip
However when the command runs the touch bar refreshes and everyone on my touch bar goes away and the only shortcut is the screen lock
I want to add the screen lock shortcut to the furtherest right position next to the touch ID sensor.
Some info:
Computer is running 10.14.6
Any help would be appreciated.
Posted on 08-22-2019 11:28 PM
#!/bin/bash
# Get the Username of the currently logged user
loggedInUser=`/bin/ls -l /dev/console | /usr/bin/awk '{ print $3 }'`
echo $loggedInUser
##Set control strip for user
#full
sudo -u $loggedInUser rm ~/Library/Preferences/com.apple.controlstrip.plist
sudo -u $loggedInUser defaults write com.apple.controlstrip FullCustomized -array-add com.apple.system.group.brightness
sudo -u $loggedInUser defaults write com.apple.controlstrip FullCustomized -array-add com.apple.system.mission-control
sudo -u $loggedInUser defaults write com.apple.controlstrip FullCustomized -array-add com.apple.system.launchpad
sudo -u $loggedInUser defaults write com.apple.controlstrip FullCustomized -array-add com.apple.system.group.keyboard-brightness
sudo -u $loggedInUser defaults write com.apple.controlstrip FullCustomized -array-add com.apple.system.group.media
sudo -u $loggedInUser defaults write com.apple.controlstrip FullCustomized -array-add com.apple.system.group.volume
sudo -u $loggedInUser defaults write com.apple.controlstrip FullCustomized -array-add com.apple.system.screen-lock
#mini
sudo -u $loggedInUser defaults write com.apple.controlstrip MiniCustomized -array-add com.apple.system.mute
sudo -u $loggedInUser defaults write com.apple.controlstrip MiniCustomized -array-add com.apple.system.volume
sudo -u $loggedInUser defaults write com.apple.controlstrip MiniCustomized -array-add com.apple.system.brightness
sudo -u $loggedInUser defaults write com.apple.controlstrip MiniCustomized -array-add com.apple.system.screen-lock
killall ControlStrip
Posted on 08-27-2019 07:55 AM
thanks @TrH This is exactly what I was looking for.
Posted on 09-17-2019 10:40 AM
How would I create the plist itself. Is there a command I need to run in terminal.