Too hackish for my taste... there must be a better way. I found an API that maybe provides what's needed. Have to test it. If not, maybe there's some dbus interface for it.