Added previous song support, activated by scrolling down while over the module

This commit is contained in:
Holden Salomon 2015-12-05 13:37:32 -05:00
parent 9a96b92f68
commit 3b82e8de1e

View File

@ -39,6 +39,7 @@ class Spotify(IntervalModule):
on_leftclick = 'playpause' on_leftclick = 'playpause'
on_rightclick = 'next_song' on_rightclick = 'next_song'
on_upscroll = 'next_song' on_upscroll = 'next_song'
on_downscroll = 'previous_song'
def get_info(self, player): def get_info(self, player):
"""gets spotify track info from playerctl""" """gets spotify track info from playerctl"""
@ -101,3 +102,7 @@ class Spotify(IntervalModule):
def next_song(self): def next_song(self):
"""skips to the next song""" """skips to the next song"""
self.player.next() self.player.next()
def previous_song(self):
"""Plays the previous song"""
self.player.previous()