0

I want to configure my operating system so that bluetooth is turned off by default after starting the computer. Currently it is activated on startup, and I have to click on the bluetooth icon in the system bar to activate "bluetooth airplane mode" to turn it off manually.

I already set the Autoenable value to false in /etc/bluetooth/main.conf (updated after mentioned in @Frantique's answer). This did not change the default behavior after restarting my system.

How to disable bluetooth by default without losing the option to activate it if needed?

Using Ubuntu 20.04.4 LTS, ubuntu-budgie-desktop Version: 0.65.

1 Answers1

1

Make a startup application* for this command:

gdbus call --session --dest org.gnome.SettingsDaemon.Rfkill --object-path /org/gnome/SettingsDaemon/Rfkill --method org.freedesktop.DBus.Properties.Set 'org.gnome.SettingsDaemon.Rfkill' 'BluetoothAirplaneMode' '<true>'

Also you can change the Autoenable value to false in /etc/bluetooth/main.conf.

* Alt + F2 and run the gnome-session-properties command

Frantique
  • 8,493
  • Thanks! Startup applications don't seem to be supported in Budgie. I already set Autoenable to false though, I will this to my question. I will try to make an autostart script in one of the (many) alternatives described here then: https://askubuntu.com/questions/814/how-to-run-scripts-on-start-up – Ingo Steinke Jul 12 '22 at 12:02
  • I placed a .desktop file to execute a shell script with the gdbus line in my ~/.config/autostart folder and rebooted my system, but bluetooth is still active after startup. – Ingo Steinke Jul 12 '22 at 12:09
  • The shell script has #!/bin/bash as first line and it is executable? – Frantique Jul 12 '22 at 12:19
  • I missed the #!/bin/bash line, but still no success after reboot. I will add a line to echo into some log file to ensure that the script is actually executed at all. – Ingo Steinke Jul 12 '22 at 12:26
  • 1
    your script works when executed directly, but it also disables Wi-Fi, probably activating airplane mode for all network devices. To restrict this to "Bluetooth Airplane Mode" (this is what it is called in the menu) only, the setting must be 'BluetoothAirplaneMode'. – Ingo Steinke Jul 12 '22 at 12:38
  • 1
    Thanks to https://askubuntu.com/questions/436999/how-do-i-diagnose-there-was-an-error-launching-the-application I found that Icon is a required entry in a .desktop file to make it work (although desktop-file-validate did not complain when it was missing). Now I finally made it work on startup. – Ingo Steinke Jul 18 '22 at 13:23