2014-09-10, 00:14
(2014-09-09, 17:02)chriswhat21 Wrote: Thank you Darius. That was a bit of a pain, but it worked. One quick note that kept my X from starting though. In your /usr/share/X11/xorg.conf.d/99-evdev.conf, the first “ in this line
and the last “ in this lineCode:Section “InputClass"
need to be replaced with ". " was probably autoformatted to “ somewhere.Code:MatchDevicePath "/dev/input/event*”
Also, the IdleTimeout from the old input.conf doesn't seem to do anything, so my batteries died. I've added "/usr/bin/bt-device --disconnect 00:21:4F:A6:3A:30" to a cron job every 10 minutes. Is there a better way to do this? A way to run a script that will sleep 600 then disconnect after the remote connects?
Ah nice catch thanks, I think Evernote "helped" the formatting..
WRT BT power off - I have this..
Disconnect on shutdown - /etc/rc.d/K99bt
Code:
#!/bin/sh
exec /home/myth/bin/bt-disconnect-all.py
Disconnect on sleep/hibernate - /etc/pm/sleep.d/01_bt
Code:
#!/bin/sh
case $1 in
hibernate|suspend)
/home/mythtv/bin/bt-disconnect-all.py
;;
thaw|resume)
;;
*)
;;
esac
Actual script to disconnect BT /home/myth/bin/bt-disconnect-all.py - copied from http://blog.asiantuntijakaveri.fi/2012/1..._8278.html
Code:
#!/usr/bin/python
import sys, re
import dbus
from optparse import OptionParser
parser = OptionParser()
parser.add_option("-i", "--device", action="store", type="string", dest="dev_id")
(options, args) = parser.parse_args()
bus = dbus.SystemBus()
manager = dbus.Interface(bus.get_object("org.bluez", "/"), "org.bluez.Manager")
if options.dev_id:
adapter_path = manager.FindAdapter(options.dev_id)
else:
adapter_path = manager.DefaultAdapter()
adapter = dbus.Interface(bus.get_object("org.bluez", adapter_path), "org.bluez.Adapter")
for path in adapter.ListDevices():
device = dbus.Interface(bus.get_object("org.bluez", path), "org.bluez.Device")
properties = device.GetProperties()
if properties['Connected']:
print "Disconnecting %s [%s]..." % (properties['Address'], properties['Name']),
try:
device.Disconnect()
print "done"
except Exception, e:
print "error (%s)" % str(e)