From a1c4b3c65e724959dc2af49b570e910de38e48a2 Mon Sep 17 00:00:00 2001 From: tobi-wan-kenobi Date: Fri, 29 Jul 2022 11:17:18 +0200 Subject: [PATCH] [modules/spotify] enable scrolling this change should enable scrolling for the spotify module (unfortunately, i am unable to fully test this, as i am not using spotify) fixes #903 --- bumblebee_status/modules/contrib/spotify.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bumblebee_status/modules/contrib/spotify.py b/bumblebee_status/modules/contrib/spotify.py index 1c7f7e2..d597b47 100644 --- a/bumblebee_status/modules/contrib/spotify.py +++ b/bumblebee_status/modules/contrib/spotify.py @@ -110,7 +110,8 @@ class Module(core.module.Module): def hidden(self): return self.string_song == "" - def __get_song(self): + @core.decorators.scrollable + def __get_song(self, widget): bus = self.__bus if self.__bus_name == "spotifyd": spotify = bus.get_object( @@ -128,11 +129,10 @@ class Module(core.module.Module): artist=",".join(props.get("xesam:artist")), trackNumber=str(props.get("xesam:trackNumber")), ) + return self.__song def update(self): try: - self.__get_song() - if self.__bus_name == "spotifyd": bus = self.__bus.get_object( "org.mpris.MediaPlayer2.spotifyd", "/org/mpris/MediaPlayer2" @@ -156,7 +156,7 @@ class Module(core.module.Module): widget.set("state", "paused") elif widget.name == "spotify.song": widget.set("state", "song") - widget.full_text(self.__song) + widget.full_text(self.__get_song(widget)) except Exception as e: self.__song = ""