Permalink
Browse files

Add CLI options to disable media keys, telepathy, and/or notifications

  • Loading branch information...
jreese committed Oct 24, 2013
1 parent 7e1f0f5 commit f767c4acf8f80d10bb3b6938bb40168fac8e0030
Showing with 24 additions and 3 deletions.
  1. +24 −3 bin/spotify
View
@@ -5,6 +5,7 @@ import base64
import dbus
import dbus.service
from dbus.mainloop.glib import DBusGMainLoop
import optparse
import os
import subprocess
import sys
@@ -300,14 +301,34 @@ class SpotifyGnome(object):
if __name__ == "__main__":
handlers = [MediaKeysHandler, TelepathyHandler]
parser = optparse.OptionParser()
parser.add_option("--no-keys", dest="keys", default=True,
action="store_false", help="disable media keys")
parser.add_option("--no-telpathy", dest="telepathy", default=True,
action="store_false", help="disable telepathy support")
parser.add_option("--no-notify", dest="notify", default=True,
action="store_false", help="disable notifications")
options, args = parser.parse_args()
handlers = []
if options.keys:
print "Enabling media keys"
handlers.append(MediaKeysHandler)
if options.telepathy:
print "Enabling telepathy"
handlers.append(TelepathyHandler)
try:
from gi.repository import Notify
from gi.repository import GObject as gobject
handlers.append(NotificationsHandler)
if options.notify:
print "Enabling notifications"
handlers.append(NotificationsHandler)
except:
print "Disabling notifications"
import gobject
SpotifyGnome(handlers)

2 comments on commit f767c4a

@nougad

This comment has been minimized.

Show comment
Hide comment
@nougad

nougad Nov 26, 2013

Maybe the parameters for --no-keys/--no-telepathy (btw: typo telpathy) and --no-notify should not passed to the spotify binary?

nougad replied Nov 26, 2013

Maybe the parameters for --no-keys/--no-telepathy (btw: typo telpathy) and --no-notify should not passed to the spotify binary?

@jreese

This comment has been minimized.

Show comment
Hide comment
@jreese

jreese Nov 28, 2013

Owner

Well spotted. Fixed in b8ade6f

Owner

jreese replied Nov 28, 2013

Well spotted. Fixed in b8ade6f

Please sign in to comment.