From f75f1a9f26c6a4b96251f076cfd369e7fc276cab Mon Sep 17 00:00:00 2001 From: tobi-wan-kenobi Date: Tue, 30 Jun 2020 07:20:54 +0200 Subject: [PATCH] [modules/spotify] fix layout parameter --- bumblebee_status/modules/contrib/spotify.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/bumblebee_status/modules/contrib/spotify.py b/bumblebee_status/modules/contrib/spotify.py index f1e925c..85b8c31 100644 --- a/bumblebee_status/modules/contrib/spotify.py +++ b/bumblebee_status/modules/contrib/spotify.py @@ -12,6 +12,8 @@ Parameters: contributed by `yvesh `_ - many thanks! added controls by `LtPeriwinkle `_ - many thanks! + +fixed icons and layout parameter by `gkeep `_ - many thanks! """ import sys @@ -28,9 +30,10 @@ class Module(core.module.Module): def __init__(self, config, theme): super().__init__(config, theme, []) - self.__layout = self.parameter( - "layout", - util.format.aslist("spotify.song,spotify.prev,spotify.pause,spotify.next"), + self.__layout = util.format.aslist( + self.parameter( + "layout", "spotify.song,spotify.prev,spotify.pause,spotify.next", + ) ) self.__song = "" @@ -77,9 +80,13 @@ class Module(core.module.Module): "cmd": self.__cmd + "PlayPause", } playback_status = str( - dbus.Interface(dbus.SessionBus().get_object( - "org.mpris.MediaPlayer2.spotify", "/org/mpris/MediaPlayer2"), "org.freedesktop.DBus.Properties") - .Get("org.mpris.MediaPlayer2.Player", "PlaybackStatus") + dbus.Interface( + dbus.SessionBus().get_object( + "org.mpris.MediaPlayer2.spotify", + "/org/mpris/MediaPlayer2", + ), + "org.freedesktop.DBus.Properties", + ).Get("org.mpris.MediaPlayer2.Player", "PlaybackStatus") ) if playback_status == "Playing": widget.set("state", "playing")