reorganize dotfiles

This commit is contained in:
Daniel Bauer
2019-03-23 15:39:18 +01:00
parent 74602784b0
commit 30779f0939
51 changed files with 68 additions and 40 deletions

View File

@@ -0,0 +1,16 @@
#!/usr/bin/python
import dbus
try:
bus = dbus.SessionBus()
spotify = bus.get_object("org.mpris.MediaPlayer2.spotify", "/org/mpris/MediaPlayer2")
spotify_iface = dbus.Interface(spotify, 'org.freedesktop.DBus.Properties')
props = spotify_iface.Get('org.mpris.MediaPlayer2.Player', 'Metadata')
try:
out = str(props['xesam:artist'][0]) + " - " + str(props['xesam:title'])
except IndexError:
out = ''
print(out)
exit
except dbus.exceptions.DBusException:
exit