Ubuntu – Ubuntu 18.04 Bluetooth Settings Missing from Upper Right Corner Menu

18.04bluetoothubuntu-gnome

TL;DR – The bluetooth settings usually available in the upper-right corner menu (along with sound, battery, user profile, power off) is only present when bluetooth is turned on, but disappears when bluetooth is turned off.

I'm a pretty long-term Ubuntu user, and have been using Ubuntu 18.04 for about a year on two different laptops. I just got a new M.2 NVMe SSD for one of the laptops and performed a fresh install of Ubuntu 18.04 on there (I removed my SATA HDD for the time being and only have Ubuntu installed on this SSD – no dual booting).

I recently went to turn on the bluetooth to pair with my headphones, and looked for the bluetooth menu option from the upper right-corner menu. To my surprise it wasn't there (see image below).

Bluetooth settings missing from upper-right corner while bluetooth is off.

Instead, I had to open my settings, navigate to bluetooth, and then turn it on. Once I had done that, the ability to turn off bluetooth or go to bluetooth settings was added back to the upper-right corner menu (see image below).

Bluetooth settings back where they normally are when bluetooth is on.

But once I turn off bluetooth, that option goes away again. Anyone encounter this and know how to keep the bluetooth settings in that upper-right corner menu? I'm not looking for blueman or an indicator along the top bar – I'm looking to just permanently keep the bluetooth settings accessible in the corner menu regardless of whether bluetooth is on or off.

For reference, here is a screenshot of the menu on my previous installation on my old HDD, showing that the bluetooth menu should still be there when bluetooth is off.

Bluetooth menu on previous installation.

Best Answer

run the below command and refresh the gnome-shell with Alt+F2 r to bring the Bluetooth menu in the top right menu.

gsettings set org.gnome.shell had-bluetooth-devices-setup true

enter image description here

But once the bluetooth is off, the above gsettings key becomes false.. to lock the value to true, run the below script with root privileges.

#!/bin/bash

keys=/etc/dconf/db/local.d/00-bt
locks=/etc/dconf/db/local.d/locks/bt

touch /etc/dconf/profile/user
echo "user-db:user" >> /etc/dconf/profile/user
echo "system-db:local" >> /etc/dconf/profile/user
mkdir -p /etc/dconf/db/local.d
touch $keys
echo "[org/gnome/shell]" >> $keys
echo "had-bluetooth-devices-setup=true" >> $keys
mkdir -p /etc/dconf/db/local.d/locks
touch $locks
echo "/org/gnome/shell/had-bluetooth-devices-setup" >> $locks
dconf update

Logout and Logback in.

Please note that.. when you turnoff bluetooth.. you need to refresh gnome-shell with Alt+F2 r Enter to bring the bluetooth option to show in the list.

** to delete the changes in future, run the below commands with root privileges.

rm -r /etc/dconf/profile/user /etc/dconf/db/local.d
dconf update

Tested in Ubuntu 18.04

Related Question