Skip to main content
Question

Big Sur - Bluetooth.menu no longer exists

  • November 18, 2020
  • 15 replies
  • 72 views

Forum|alt.badge.img+3

We have a set of scripts that keep all devices CIS compliant.

On Catalina this snippet ensured the bluetooth menu was visible.

#!/bin/bash
#CIS 2.1.3 enable bluetooth menu bar
if [[ "$loggedInUser" != "root" ]] && [[ "$loggedInUID" -ne 0 ]]; then
    btMenuBar="$(defaults read /Users/"$loggedInUser"/Library/Preferences/com.apple.systemuiserver menuExtras | grep -c Bluetooth.menu)"
    if [ "$btMenuBar" = "0" ]; then
        sudo -u $loggedInUser open "/System/Library/CoreServices/Menu Extras/Bluetooth.menu"
    fi
fi

Post Big Sur upgrade the /System/Library/CoreServices/Menu Extras/Bluetooth.menu file no longer exists and although I do see a bluetooth menu item on my screen, I can not for the life of me figure out how to open it from the command line.

Any suggestions?

15 replies

mm2270
Forum|alt.badge.img+24
  • Legendary Contributor
  • November 18, 2020

I haven't been able to test anything yet, but a user named @mikelaundrie posted on another thread that some of the missing menu bar items might now exist in the com.apple.controlcenter.plist file. See here:
https://www.jamf.com/jamf-nation/discussions/10576/menu-bar-customization#responseChild209331


Forum|alt.badge.img+6
  • Contributor
  • November 18, 2020

I saw the same in our environment. I guess it's because of the new control center. There is a plist file called com.apple.controlcenter in the same folder. You will have the same issue with the Wi-Fi symbol and the CIS 4.2
Edit: There was someone faster than me :) I tested it, but it is still not working for me.


Forum|alt.badge.img+1
  • New Contributor
  • December 1, 2020

Diving a little deeper it looks like modifying the ~/Library/Preferences/ByHosts preference for the control center seems to do the trick. I'm a bit concerned that there might be more to these integer values than meets the eye, but it's worth testing, so I wanted to put it out there. Here's the code to show bluetooth in the menu bar

defaults write ~/Library/Preferences/ByHost/com.apple.controlcenter.plist Bluetooth -int 18

Changing the int to 24 will hide it. Changing it to 1 will also hide it. changing it to 2 will also show it. Please give it a whirl and let me know how it works for you.


Cayde-6
Forum|alt.badge.img+22
  • Honored Contributor
  • December 1, 2020

Thought I was going mad!!! Nothing showed on Google searches


Cayde-6
Forum|alt.badge.img+22
  • Honored Contributor
  • December 14, 2020

This no longer seems to work again

Script result: 2020-12-14 17:09:14.422 defaults[2040:13293] 
The domain/default pair of (/Users/lewis/Library/Preferences/ByHost/com.apple.controlcenter.plist, Bluetooth) does not exist

Forum|alt.badge.img+9
  • Contributor
  • December 14, 2020

As some others have mentioned, this can now be found in the com.apple.controlcenter plist. I have also confirmed that Wifi and Volume also work in this plist.


Cayde-6
Forum|alt.badge.img+22
  • Honored Contributor
  • December 14, 2020

@cbutcher My post clearly shows I was referring to com.apple.controlcenter.plist :)

Disable Bluetooth

sudo -u ${loggedInUser} defaults write /Users/${loggedInUser}/Library/Preferences/ByHost/com.apple.controlcenter.plist Bluetooth -int 18

Script result: 2020-12-14 17:09:14.422 defaults[2040:13293] The domain/default pair of (/Users/lewis/Library/Preferences/ByHost/com.apple.controlcenter.plist, Bluetooth) does not exist


Forum|alt.badge.img
  • New Contributor
  • January 6, 2021

This is working for me, running this script in self service.

currentUser=$( ls -l /dev/console | awk '{print $3}' )
sudo -u ${currentUser} defaults write /Users/${currentUser}/Library/Preferences/ByHost/com.apple.controlcenter.plist Bluetooth -int 18
exit 0


Forum|alt.badge.img+2
  • New Contributor
  • February 22, 2021

@agagnon is this script still working for you? I tried it and Bluetooth icon is still in control center.

Tried @joebesser command suggestion but that did not work for me either.

Anyone else got something working to remove icons from Control Center or the entire control center icon from the menu bar itself?


Cayde-6
Forum|alt.badge.img+22
  • Honored Contributor
  • February 22, 2021

@apatel The script works for me but it needs a restart before it takes effect.


TomRWSmith
Forum|alt.badge.img+3
  • New Contributor
  • April 13, 2021

I've managed to use @agagnon code for the Bluetooth icon on the Menu Bar in Big Sur, which works fine for me.

Does anyone know how to show the battery percentage on the Menu Bar in Big Sur via a script? I've got the below script for Catalina however this doesn't work with Big Sur.

currentUser=`ls -l /dev/console | cut -d " " -f4`
sudo -u $currentUser defaults write com.apple.menuextra.battery ShowPercent YES
sudo -u $currentUser killall SystemUIServer

Forum|alt.badge.img+18
  • Esteemed Contributor
  • May 14, 2021

@Tomsmithdrpg This command enables the battery percent without the need to run the kill all. Seems to just work instantly:

~/Library/Preferences/ByHost/com.apple.controlcenter.plist BatteryShowPercentage -bool true

Gabe Shackney
Princeton Public Schools


TomRWSmith
Forum|alt.badge.img+3
  • New Contributor
  • June 8, 2021

Sorry for hijacking the post again but managed to get the Battery Percentage to finally show on the Menu Bar in Big Sur. Thanks @gshackney for your help I managed to put something together from few different sources and using your suggestion above.

Hopefully, this helps someone else out in the future, ran as a once per computer script for Big Sur devices.

#!/bin/bash

_user=`who | grep console | awk '{ print $1 }'`

sudo -u $_user defaults write /Users/$_user/Library/Preferences/ByHost/com.apple.controlcenter.plist BatteryShowPercentage -bool true

rajrajan
Forum|alt.badge.img+6
  • Contributor
  • September 1, 2021

Thank You! 

 

 


  • New Contributor
  • September 15, 2025

This is still working on Sonoma and Sequoia! I decided to push it in Jamf “once per user” for our use case!

 

Thank you so much!!