Git Product home page Git Product logo

spotify-gnome's Introduction

Spotify Gnome Integration

NOTE: This project is no longer required in order to use media keys with Spotify on Gnome. It will not receive any updates going forward.

This program provides Gnome media key support for the Spotify Linux client.

The Spotify client supports DBus for controlling the player, using the MPRIS Specification, but does not listen for basic media key signals provided by Gnome. This program acts as a "wrapper" around Spotify to translate media key signals from Gnome and send them to the Spotify client.

It supports the play/pause, stop, next, and previous signals, and is compatible with both Gnome 2 and Gnome 3.

NEW Jan 2013 - Get Now Playing integration for telepathy based clients such as Empathy,Pidgin,Kde Telepathy Sugar using lib telepahty support from gobject-introspection - [email protected] Edit : Added basic advertisement filtering for advertisements in the telepathy statuses

Many thanks to Mike Houston at kothar.net and Fran Diéguez at Mabishu for their blog postings that pointed me in the right directions to get this implemented.

Installation

Verify that your copy of Spotify installed its binary to /usr/bin/spotify:

$ which spotify
/usr/bin/spotify

If it was installed to a different location, you will need to edit bin/spotify to set spotify_bin to the appropriate path.

Copy bin/spotify to /usr/local/bin/spotify, or a different path that takes precedent over the location of your spotify binary:

$ sudo install bin/spotify /usr/local/bin/

Launching spotify via application launcher or from the command line should now start the wrapper first, which will then launch the real Spotify client. Enjoy having media keys that work for both Spotify and other media players.

Support

Spotify-Gnome was created by John Reese, and copyright (c) 2011. Telepathy support - Dhananjay Sathe Notification support - Matthew Bray Spotify-Gnome is licensed under the MIT license. See the LICENSE files for details.

Bugs can be reported on Github.

spotify-gnome's People

Contributors

amyreese avatar dhananjaysathe avatar flore2003 avatar franziskuskiefer avatar jhuesos avatar mattjbray avatar scott-joe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spotify-gnome's Issues

Create a verbose mode

We spew too much output to the console , we could just spew if the -v flag is enabled .
I am up for providing the patch for this change , what do you guys think ?

Music Player Daemon - Disconnected

Strange that his worked the first day, and now not ...

Anyway:

The current issue is that the media keys with Spotify and your script simply throws a strange error on the screen in Gnome3 (ArchLinux) that says:

"Music Player Daemon - Disconnected".

Though if I launch your script from the command line, there are no errors about this. Seems to 'connect to media keys' just fine.

Any ideas or suggestion of what what I should provide to help debug this?

Easy option to disable Telepathy?

I am always logged on to Empathy. The updated version of this wrapper updates my gchat status (via Empathy) with what song I'm listening to. I don't want the whole world seeing that. The code was very easy to read, so it was simple to solve my problem. I changed "handlers = [MediaKeysHandler, TelepathyHandler]" to "handlers = [MediaKeysHandler]". So, for the sake of those that don't like code, I have a small suggestion: make a clear option to disable Telepathy or add a note in the documentation for how to do this. P.S. the bug tracker web site was down when I tried to access it.

Transient Notifications

It would be nice to make the notifications transient, or at least add an option for it.
Could be done by adding:

self.notification.set_hint_uint32("transient",1)

Disable media keys actions

Spotify now natively supports media keys. This means that play-pause key now acts twice, being essentially useless, if this wrapper is used.

This must be dealt with somehow: either completely removing the feature, or making it optional.

PlayPause has double effect

When I press the PlayPause key, the effect is as if it had pressed twice, so the status ends up the same as before I press it.

This is what the log shows:

Received MediaPlayerKeyPressed:
  (dbus.String(u'Spotify'), dbus.String(u'Play'))
Received PropertiesChanged:
  dbus.Dictionary({dbus.String(u'PlaybackStatus'): dbus.String(u'Playing', variant_level=1)}, signature=dbus.Signature('sv'))
Received PropertiesChanged:
  dbus.Dictionary({dbus.String(u'PlaybackStatus'): dbus.String(u'Playing', variant_level=1)}, signature=dbus.Signature('sv'))
Received PropertiesChanged:
  dbus.Dictionary({dbus.String(u'PlaybackStatus'): dbus.String(u'Paused', variant_level=1)}, signature=dbus.Signature('sv'))
Received PropertiesChanged:
  dbus.Dictionary({dbus.String(u'PlaybackStatus'): dbus.String(u'Paused', variant_level=1)}, signature=dbus.Signature('sv'))

So one single key press, yet two actions: Play and Pause.

If I run this on the shell:

dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause

Then it works just fine.

Any ideas?

I'm on Ubuntu 12.04 LTS. If you need more information about versions of various things, please let me know. I'm trying this with current HEAD of master branch.

Doesn't work with latest Spotify for Ubuntu

On Ubuntu 12.04, latest spotify app.
Play/pause key does nothing.

~ % spotify
Setting up DBus...
Connecting to NameOwnerChanged...
Connect to MediaKeys...
Launching Spotify...
Cannot connect to server socket err = No such file or directory
Cannot connect to server socket
jack server is not running or cannot be started
14:15:38.422 I [breakpad.cpp:62                 ] Registered Breakpad for product: spotify

Received NameOwnerChanged:
  org.mpris.MediaPlayer2.spotify -  - :1.1888
14:15:38.423 I [translate.cpp:123               ] Reloading language file
14:15:38.455 I [breakpad.cpp:192                ] Searching for crashdumps: /home/kill/.cache/spotify/*.dmp

14:15:38.973 A [CefModule.cpp:327               ] Check failed: g_cef_handle: 
14:15:39.506 I [ap:1755                         ] Connecting to AP E2.spotify.com:4070
14:15:39.684 I [ap:1229                         ] Connected to AP: 193.182.8.39:4070
14:15:40.476 I [mainview:984                    ] Registering bundled app html with version 0.1.0
14:15:40.476 I [mainview:987                    ] Registering bundled framework import with version 0.1.0
14:15:40.476 I [mainview:987                    ] Registering bundled framework bridge-desktop with version 0.4.0
14:15:40.476 I [mainview:987                    ] Registering bundled framework api with version 0.1.0
14:15:40.476 I [mainview:987                    ] Registering bundled framework resources with version 0.2.0
14:15:40.476 I [mainview:987                    ] Registering bundled framework unstable with version 0.2.1
14:15:40.476 I [mainview:987                    ] Registering bundled framework util with version 0.1.0
14:15:40.476 I [mainview:984                    ] Registering bundled app album-header with version 1.0.0
14:15:40.476 I [mainview:984                    ] Registering bundled app bundles with version 1.0.0
14:15:40.476 I [mainview:984                    ] Registering bundled app error with version 1.0.0
14:15:40.476 I [mainview:984                    ] Registering bundled app feed with version 1.0.3
14:15:40.476 I [mainview:984                    ] Registering bundled app finder with version 1.1.0
14:15:40.476 I [mainview:984                    ] Registering bundled app home with version 1.0.0
14:15:40.476 I [mainview:984                    ] Registering bundled app install with version 1.0.0
14:15:40.476 I [mainview:984                    ] Registering bundled app people with version 1.0.0
14:15:40.476 I [mainview:984                    ] Registering bundled app profile with version 1.0.3
14:15:40.476 I [mainview:984                    ] Registering bundled app profile-header with version 1.0.3
14:15:40.476 I [mainview:984                    ] Registering bundled app radio with version 1.0.1
14:15:40.476 I [mainview:984                    ] Registering bundled app search-dropdown with version 1.0.1
14:15:40.476 I [mainview:984                    ] Registering bundled app search-header with version 1.0.0
14:15:40.476 I [mainview:984                    ] Registering bundled app share with version 1.0.2
14:15:40.476 I [mainview:984                    ] Registering bundled app subscribe-popup with version 1.1.0
14:15:40.476 I [mainview:984                    ] Registering bundled app og-popup with version 1.0.1
14:15:40.476 I [mainview:984                    ] Registering bundled app notification-popup with version 0.0.24
"sni-qt/9049" WARN  16:15:40.553 void StatusNotifierItemFactory::connectToSnw() Invalid interface to SNW_SERVICE 
14:15:40.596 I [AppManager.cpp:147              ] Created instance of the application feed.
14:15:40.604 I [AppManager.cpp:147              ] Created instance of the application search-dropdown.
14:15:40.611 I [AppManager.cpp:147              ] Created instance of the application notification-popup.
14:15:40.621 I [AppManager.cpp:147              ] Created instance of the application home.
14:15:40.638 I [AppManager.cpp:189              ] Keeping application What's New alive for 60000 ms.
14:15:40.640 I [offline-mgr:2136                ] Storage has been cleaned
14:15:41.336 I [mainview:6830                   ] Load complete (0) url: sp://feed/index.html
14:15:41.694 I [mainview:6830                   ] Load complete (0) url: sp://home/index.html
14:15:41.733 E [xml_sax_parser_expat.cpp:66     ] not well-formed (invalid token) at line 1, column 6
[1019/161543:ERROR:nss_ocsp.cc(581)] No URLRequestContext for OCSP handler.
[1019/161543:ERROR:nss_ocsp.cc(581)] No URLRequestContext for OCSP handler.
[1019/161543:ERROR:nss_ocsp.cc(581)] No URLRequestContext for OCSP handler.
[1019/161543:ERROR:nss_ocsp.cc(581)] No URLRequestContext for OCSP handler.
[1019/161543:ERROR:nss_ocsp.cc(581)] No URLRequestContext for OCSP handler.
14:15:51.640 I [AppManager.cpp:189              ] Keeping application What's New alive for 60000 ms.
14:15:51.958 I [AppManager.cpp:147              ] Created instance of the application album-header.
14:15:55.522 I [audio_driver_linux.cpp:19       ] Using PulseAudio

Changing song turn gnome notifications "on" and change telepathy status

One of my main reasons for using Gnome is the power to silence all the notifications.

However, when the current song end and the next one starts playing, spotify-gnome changes my telepathy status from "busy" to "available" and in doing so turns the notifications "on".

Spotify-gnome features are excellent but this behaviour interferes with my workflow.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.