Conky Spotify?

Howdy all is anyone running Spotify with conky would like to see songs in my bar as with mpd. dkwm

By the way Dobbie03 np script works fine with Spotify. :grinning:

1 Like

What bar do you mean?

I,m running conky piped to lemonbar in dk, but would just like it to work with any conkybar.

Just like ncmpcpp now playing in the bar.

Been trying this as a script.

#!/bin/bash
 
echo "  Artist:" `dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'Metadata'|egrep -A 2 "artist"|egrep -v "artist"|egrep -v "array"|cut -b 27-|cut -d '"' -f 1|egrep -v ^$` 
echo "  Title: " `dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'Metadata'|egrep -A 1 "title"|egrep -v "title"|cut -b 44-|cut -d '"' -f 1|egrep -v ^$`
echo "  Album: " `dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'Metadata'|egrep -A 1 "album"|egrep -v "album"|cut -b 44-|cut -d '"' -f 1|egrep -v ^$`

This is my user dbus status

systemctl --user status dbus
● dbus.service - D-Bus User Message Bus
     Loaded: loaded (/usr/lib/systemd/user/dbus.service; static)
     Active: active (running) since Sat 2022-01-22 13:48:10 AEST; 3h 4min ago
TriggeredBy: ● dbus.socket
       Docs: man:dbus-daemon(1)
   Main PID: 736 (dbus-daemon)
      Tasks: 4 (limit: 38403)
     Memory: 3.4M
        CPU: 80ms
     CGroup: /user.slice/user-1000.slice/user@1000.service/app.slice/dbus.service
             ├─736 /usr/bin/dbus-daemon --session --address=systemd: --nofork --nopidfile --systemd-activation --syslog-on>
             └─806 /usr/lib/xfce4/xfconf/xfconfd

Jan 22 13:48:10 archlabs systemd[584]: Started D-Bus User Message Bus.
Jan 22 13:48:11 archlabs dbus-daemon[736]: [session uid=1000 pid=736] Activating via systemd: service name='org.a11y.Bus' >
Jan 22 13:48:11 archlabs dbus-daemon[736]: [session uid=1000 pid=736] Successfully activated service 'org.a11y.Bus'
Jan 22 13:48:11 archlabs dbus-daemon[736]: [session uid=1000 pid=736] Activating service name='org.xfce.Xfconf' requested >
Jan 22 13:48:11 archlabs dbus-daemon[806]: writing oom_score_adj error: Permission denied
Jan 22 13:48:11 archlabs dbus-daemon[736]: [session uid=1000 pid=736] Successfully activated service 'org.xfce.Xfconf'
Jan 22 13:48:11 archlabs dbus-daemon[736]: [session uid=1000 pid=736] Activating via systemd: service name='org.gtk.vfs.Da>
Jan 22 13:48:11 archlabs dbus-daemon[736]: [session uid=1000 pid=736] Successfully activated service 'org.gtk.vfs.Daemon'
lines 1-21/21 (END)

With this line in my .conkyrc file.

%{l} ${exec /home/.config/dk/spotify.sh}