You are not logged in.

#1 2021-12-03 16:39:01

Jackal87
Member
Registered: 2021-12-03
Posts: 2

[SOLVED] Bluetooth toggle in i3 not working

Hi,

I'm setting up i3 on my laptop. Now I want to toggle my Bluetooth controller with the XF86Bluetooth key, so I wrote a little script that works well in console:

#!/usr/bin/env bash

if bluetoothctl show | grep 'Powered: no' -q; then
  bluetoothctl power on
else
  bluetoothctl power off
fi

In i3 I let that script run when I press the Bluetooth key:

bindsym XF86Bluetooth exec --no-startup-id bluetooth-onoff

But now I'm just able to turn my Bluetooth off. When I try to turn it on, bluetoothctl show just says "No default controller available".

Has anyone an Idea why this is happening?

Last edited by Jackal87 (2021-12-04 17:14:51)

Offline

#2 2021-12-04 17:13:42

Jackal87
Member
Registered: 2021-12-03
Posts: 2

Re: [SOLVED] Bluetooth toggle in i3 not working

Ok, it seems I was a bit dumb.

The Bluetooth key on my Laptop toggles the Bluetooth controller without any script needed.
I thought of it just as a programable Hot-Key, but it is actually a Killswitch. So running the script on the same key obviously causes problems.

My real problem was a wrong configuration of blueman-applet. For some reason I deactivated the KillSwitch extension so I couldnt see the real status of the controller.

Offline

Board footer

Powered by FluxBB