Results 1 to 1 of 1

Thread: [How-to] Spotify under Wine with multimedia keys and OSD

  1. #1
    Join Date
    Jan 2015

    [How-to] Spotify under Wine with multimedia keys and OSD


    After some experimentation, and Spotify-notify (a project on GitHub) having failed me, I found out how to do the following:

    1. Control (Next, previous, play/pause) Spotify.exe (running under Wine) with any keys on your keyboard
    2. Show the title and artist information of the song switched to in a Ubuntu notification bubble (notify-osd)

    This is awesome, because it makes Spotify running under Wine (the best Spotify solution currently available for Linux in my opinion) that more useful, and it feels super native!


    I own an Acer C720 Chromebook running Xubuntu 14.10. I remapped my keys a while ago using this guide:

    The guide:

    1. Run this in terminal:
    sudo apt-get install xbindkeys xdotool
    2. Download spotify_cmd from this link:

    3. Put the contents of the .zip (spotify_cmd.exe and in your home folder.

    4. Decide which keys you want to use for 1. Next song, 2. Previous song and 3. Play/pause. (In my case I remapped my F1 key to Greek_NU with xmodmap because F1 already does something in Spotify and Chrome, which I found annoying. I then decided to use Greek_NU for previous song, F2 for next song, and F5 for play/pause)

    5. Run the following command:
    sudo gedit ~/.xbindkeysrc
    6. Paste these lines in the file:
    "xdotool keyup Greek_NU; ./spotify_cmd.exe prev; notify-send -i /usr/share/icons/Numix-Circle/48x48/apps/spotify.svg "Now playing" "`./spotify_cmd.exe status | tail -n +2 | head -1` - `./spotify_cmd.exe status | tail -n +3 | head -2`"  --urgency=critical --expire-time=1500"
    "xdotool keyup F2; ./spotify_cmd.exe next; notify-send -i /usr/share/icons/Numix-Circle/48x48/apps/spotify.svg "Now playing" "`./spotify_cmd.exe status | tail -n +2 | head -1` - `./spotify_cmd.exe status | tail -n +3 | head -2`" --urgency=critical --expire-time=1500"
    "xdotool keyup F5; ./spotify_cmd.exe playpause; notify-send -i /usr/share/icons/Numix-Circle/48x48/apps/spotify.svg "Play/pause" --expire-time=1000"
    7. Replace the key symbol names (in red) with the keys you want to use. A list of key symbol names can be found here:

    8. Replace the lines in blue with paths leading to the Spotify icon you want to use. (I use the one from the Numix Circle icon theme)

    9. Now run:
    killall xbindkeys
    xbindkeys &
    It should work now! Run Spotify (running under Wine) and check it out!

    Remember, you can be creative with the lines. To give you a start, what my Greek_NU key does is basically run '
    ./spotify_cmd.exe prev' to skip to the previous song. "Now playing" is the title of the notification bubble. (You can change this or remove it altogether) Then `./spotify_cmd.exe status | tail -n +2 | head -1` is a command which fetches the artist name from spotify_cmd.exe, and `./spotify_cmd.exe status | tail -n +3 | head -2` fetches the song title. '--expire-time=1500' means that the notification bubble will be displayed for a 1500 milliseconds. The Google Code spotifycmd website lists more commands you could potentially use.

    Edit: Found a way to have cover art in the notifications as well

    1. Download

    2. Extract into your home directory.

    3. Bind your keys to 'bash ~/spotify_buttons/', 'bash ~/spotify_buttons/', and 'bash ~/spotify_buttons/'.

    4. Have fun, it looks and works awesome!

    (This works by sending artist+title+'cover' to Google and downloading the first square jpg image)

    Have fun with it and don't hesitate to ask me questions!
    Last edited by Maxim_Buur; February 1st, 2015 at 07:34 PM. Reason: Added a screenshot


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts