gmdfalk / blockify

mute spotify adverts on linux
MIT License
354 stars 42 forks source link

Consider using DBus signaling capabilties #100

Open Sekuraz opened 8 years ago

Sekuraz commented 8 years ago

Polling the dbus status of spotify does not work for me so I built this little script working with dbus signaling and based on a very minimal subset of your code.

You should also consider making python-docopt a hard dependency. (blockify-minmal.txt)

gmdfalk commented 8 years ago

Thanks for the suggestion! You are the first person to report that the Spotify dbus session isn't working. Do have any idea why? I am asking because if this problem is likely to occur for a wide range of systems I'd look at implementing this. Otherwise I'm putting it in my backlog for this project.

Sekuraz commented 8 years ago

It works in the gui session but not in the terminal one (I think, according to the ini sample, that polling is done every 200 seconds or so). When I was debugging this problem I read a little into dbus and one of the first things i saw was the event driven stuff. So I implemented it straight away simplifying and reducing the stuff you did. It completely avoids polling so it seems to be a good solution for all polling related issues (cpu load, unknown timeouts of dbus (10 - 30 seconds! on a method call) and so on).