Merge pull request #667 from gkeep/spotify-improvements
[modules/spotify] Icon improvements
This commit is contained in:
commit
6839e81342
3 changed files with 27 additions and 17 deletions
|
@ -50,13 +50,6 @@ class Module(core.module.Module):
|
||||||
)
|
)
|
||||||
spotify_iface = dbus.Interface(spotify, "org.freedesktop.DBus.Properties")
|
spotify_iface = dbus.Interface(spotify, "org.freedesktop.DBus.Properties")
|
||||||
props = spotify_iface.Get("org.mpris.MediaPlayer2.Player", "Metadata")
|
props = spotify_iface.Get("org.mpris.MediaPlayer2.Player", "Metadata")
|
||||||
playback_status = str(
|
|
||||||
spotify_iface.Get("org.mpris.MediaPlayer2.Player", "PlaybackStatus")
|
|
||||||
)
|
|
||||||
if playback_status == "Playing":
|
|
||||||
self.__pause = "\u258D\u258D"
|
|
||||||
else:
|
|
||||||
self.__pause = "\u25B6"
|
|
||||||
self.__song = self.__format.format(
|
self.__song = self.__format.format(
|
||||||
album=str(props.get("xesam:album")),
|
album=str(props.get("xesam:album")),
|
||||||
title=str(props.get("xesam:title")),
|
title=str(props.get("xesam:title")),
|
||||||
|
@ -77,20 +70,29 @@ class Module(core.module.Module):
|
||||||
"button": core.input.LEFT_MOUSE,
|
"button": core.input.LEFT_MOUSE,
|
||||||
"cmd": self.__cmd + "Previous",
|
"cmd": self.__cmd + "Previous",
|
||||||
}
|
}
|
||||||
widget.full_text("\u258F\u25C0")
|
widget.set("state", "prev")
|
||||||
elif widget_name == "spotify.pause":
|
elif widget_name == "spotify.pause":
|
||||||
widget_map[widget] = {
|
widget_map[widget] = {
|
||||||
"button": core.input.LEFT_MOUSE,
|
"button": core.input.LEFT_MOUSE,
|
||||||
"cmd": self.__cmd + "PlayPause",
|
"cmd": self.__cmd + "PlayPause",
|
||||||
}
|
}
|
||||||
widget.full_text(self.__pause)
|
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")
|
||||||
|
)
|
||||||
|
if playback_status == "Playing":
|
||||||
|
widget.set("state", "playing")
|
||||||
|
else:
|
||||||
|
widget.set("state", "paused")
|
||||||
elif widget_name == "spotify.next":
|
elif widget_name == "spotify.next":
|
||||||
widget_map[widget] = {
|
widget_map[widget] = {
|
||||||
"button": core.input.LEFT_MOUSE,
|
"button": core.input.LEFT_MOUSE,
|
||||||
"cmd": self.__cmd + "Next",
|
"cmd": self.__cmd + "Next",
|
||||||
}
|
}
|
||||||
widget.full_text("\u25B6\u2595")
|
widget.set("state", "next")
|
||||||
elif widget_name == "spotify.song":
|
elif widget_name == "spotify.song":
|
||||||
|
widget.set("state", "song")
|
||||||
widget.full_text(self.__song)
|
widget.full_text(self.__song)
|
||||||
else:
|
else:
|
||||||
raise KeyError(
|
raise KeyError(
|
||||||
|
|
|
@ -297,7 +297,11 @@
|
||||||
"prefix": ""
|
"prefix": ""
|
||||||
},
|
},
|
||||||
"spotify": {
|
"spotify": {
|
||||||
"prefix": ""
|
"song": { "prefix": "spotify" },
|
||||||
|
"prev": { "prefix": "|<" },
|
||||||
|
"playing": { "prefix": "|>" },
|
||||||
|
"paused": { "prefix": "||" },
|
||||||
|
"next": { "prefix": ">|" }
|
||||||
},
|
},
|
||||||
"uptime": {
|
"uptime": {
|
||||||
"prefix": "uptime"
|
"prefix": "uptime"
|
||||||
|
|
|
@ -219,7 +219,11 @@
|
||||||
"prefix": " "
|
"prefix": " "
|
||||||
},
|
},
|
||||||
"spotify": {
|
"spotify": {
|
||||||
"prefix": " "
|
"song": { "prefix": "" },
|
||||||
|
"prev": { "prefix": "" },
|
||||||
|
"playing": { "prefix": "" },
|
||||||
|
"paused": { "prefix": "" },
|
||||||
|
"next": { "prefix": "" }
|
||||||
},
|
},
|
||||||
"publicip": {
|
"publicip": {
|
||||||
"prefix": " "
|
"prefix": " "
|
||||||
|
|
Loading…
Reference in a new issue