I have created a custom Application indicator with 3 menu items viz. Rewind, Forward & Quit. I have tested it in unity it works fine. It can give you some idea. I am trying to make it look like picture provided by you. Meanwhile I am posting the code that I am using you can work on that too.
Requirement: mdbus2
Install it using: sudo apt-get install mdbus2
Below is the python code:
#!/usr/bin/env python
'''
To rewind and forward the currently playing song
depend on mbus2 and can be installed using sudo apt-get install mbus2
version 0.1 (public domain)
Author: Vivek Mishra
'''
import dbus
bus = dbus.SessionBus()
proxy = bus.get_object('org.mpris.MediaPlayer2.rhythmbox','/org/mpris/MediaPlayer2')
player = dbus.Interface(proxy, 'org.mpris.MediaPlayer2.Player')
APPNAME = "Player Navigation"
ICON = "/usr/share/icons/hicolor/48x48/apps/totem.png"
from gi.repository import AppIndicator3 as AI
from gi.repository import Gtk
# Forwards a song for 100 sec
def forward(item):
player.Seek(100000000)
# Rewinds a song for 100 sec
def rewind(item):
player.Seek(-100000000)
def scroll(aai, ind, steps):
print "hello" # doesn't print anything
def makemenu():
' Set up the menu '
menu = Gtk.Menu()
forward_item = Gtk.MenuItem('Forward')
forward_item.connect('activate', forward)
forward_item.show()
rewind_item = Gtk.MenuItem('Rewind')
rewind_item.connect('activate', rewind)
rewind_item.show()
exit_item = Gtk.MenuItem('Quit')
exit_item.connect('activate', Gtk.main_quit)
exit_item.show()
menu.append(forward_item)
menu.append(rewind_item)
menu.append(exit_item)
menu.show()
return menu
def startapp():
ai = AI.Indicator.new(APPNAME, ICON, AI.IndicatorCategory.HARDWARE)
ai.set_status(AI.IndicatorStatus.ACTIVE)
ai.set_menu(makemenu())
ai.connect("scroll-event", scroll)
Gtk.main()
startapp()
Hope this helps. :)