You are not logged in.
Pages: 1
Hi there!
I'd like to handle bluetooth manually. So I use this command to turn the device on and it connects to my device automatically.
$ echo -e 'power on\nquit' | bluetoothctlthis command runs fine on my xfce4 logon but it doesn't turn the device on when I attempt to evoke it from /usr/lib/systemd/system-sleep/script.sh
in order to have it run after resume from suspend. It returns:
[bluetooth]# power on
No default controller availableThe command works fine when I run it simple by root user.
I tried to delay an execution adding "sleep 3" before the command and it doesn't help.
Does anybody have any ideas why bluetoothctl doesn't see a bluetooth controller when runs by systemd?
Offline
I don't think pipes can be used from systemd units.
You said you want to control it manually, but is the Bluetooth service running? If not how are you starting the bluetoothd daemon?
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way
Offline
Hey! Thanks for the response!
And there is no any other option to run a script on resume from suspend, huh?
The Bluetooth service is certainly running. Systemd starts it as usual.
Last edited by Speranskiy (2016-01-23 16:27:43)
Offline
Pages: 1