Linux bluetooth development
 help / color / mirror / Atom feed
From: Jonathan Haug <jonathanhaug@wolke7.net>
To: linux-bluetooth@vger.kernel.org
Subject: Check for connections and disable bluetooth in shell
Date: Tue, 31 Aug 2010 07:58:19 +0200	[thread overview]
Message-ID: <1283234299.1702.12.camel@josua> (raw)


Dear bluetooth-experts,

I want to disable bluetooth on my system (via commandline), if there is
no active bluetooth connection -- without being root.

Therefor I need a way to

1.  check if there is an active bluetooth connection

2.  disable bluetooth without being root


For the second part I found

dbus-send --system --type=method_call --dest=org.bluez $(dbus-send
--system --print-reply --dest=org.bluez / org.bluez.Manager.ListAdapters
| awk -F'"' '/at/ {print $2}') org.bluez.Adapter.SetProperty
string:Powered variant:boolean:false

but this doesn't really disable bluetooth: I'm still able to deactivate
bluetooth in the panel.

For the first part I could not find a solution so far.

I'm running Ubuntu 10.04.

Thanks for your help!

Jonathan Haug



             reply	other threads:[~2010-08-31  5:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-31  5:58 Jonathan Haug [this message]
2010-08-31  6:04 ` Check for connections and disable bluetooth in shell Gustavo F. Padovan
2010-10-07  5:01   ` Jonathan Haug

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1283234299.1702.12.camel@josua \
    --to=jonathanhaug@wolke7.net \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox